22 lines
474 B
Python
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]
|
|
'''
|