Files
ola5doc/content/.stversions/leo-martin/sources/un-premier-essai-avec-pattern~20171216-141001.py
T

22 lines
474 B
Python

from pattern.fr import parsetree, parse, split
texte = parse(u"Le petit chat attend que l'esclave humain daigne lui apporter son repas.")
#print texte
for phrase in split( texte ):
# print sentence.__dict__.keys()
print phrase.words
print "---"
# print split( texte ).words[0].__dict__.keys()
print split( texte ).words[0].type
'''
for lexeme in lexemes:
for chunk in lexeme.chunks:
print chunk.type, [(w.string, w.type) for w in chunk.words]
'''