Skip to content

Instantly share code, notes, and snippets.

@proycon
Last active April 16, 2019 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proycon/9bc90d77a4d5422c8e50364bf4ca30d4 to your computer and use it in GitHub Desktop.
Save proycon/9bc90d77a4d5422c8e50364bf4ca30d4 to your computer and use it in GitHub Desktop.
import folia.main as folia
import sys
doc = folia.Document(file=sys.argv[1])
for p in doc.paragraphs():
print("Text:", p.text())
try:
print("Language:", p.annotation(folia.LangAnnotation).cls)
except folia.NoSuchAnnotation:
print("No language for this paragraph")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment