Problems with the creation of word and chunk objects in Pattern

21 views
Skip to first unread message

gva...@gmail.com

unread,
Jan 28, 2015, 10:11:04 AM1/28/15
to pattern-f...@googlegroups.com
Hello. I am new to pattern (and MBSP) and I am capable of creating text and sentence objects. However, I struggle with the creation of word and chunk objects. Maybe somebody could enlighten me with what I am doing incorrectly.

This is what I am trying to do:

string = 'I ate pizza.'

taggedstring = parse(string)

text = Text(taggedstring)


Text object is created and I can use the its methods / functions.

sentence = Sentence(taggedstring)


Again, sentence object is created and I can use its methods / functions.

However, when I try to generate words / chunks I am unable to do that. When I follow the online example of generating the word object:

word = Word(sentence, string, lemma=None, type=None, index=0)


I am not sure what does the “string” mean here. If I use the identical procedure as mentioned, then some functions / methods do not yield any results. It is similar when I try to create the chunks object. What does “words = []” mean in this case.

chunk = Chunk(sentence, words=[], type=None, role=None, relation=None)

I have checked the help in ipython but it is not very intuitive to me. I am quite new to programming though.

Hope somebody can help me out with this one.

Best,

Gvozden
Reply all
Reply to author
Forward
0 new messages