Skip to content
garfix edited this page Jan 1, 2014 · 3 revisions

Here is an example of a sentence that is parsed, and the relations it yields:

// parse: "John reads the red book"

$English = GrammarFactory::getGrammar('en'); $Processor = new SentenceProcessor(); $Sentence = $Processor->parseSentence('John reads the red book', $English);

// result: $relations = $Sentence->getSemanticsString());

// these are the relations found

sentence(S.event) mood(S.event, Declarative) and

isa(S.event, Read) and tense(S.event, Present) and

subject(S.event, S.subject) and name(S.subject, "John") and

object(S.event, S.object) and isa(S.object, Book) and determiner(S.object, The) and

modifier(S.object, S_Clause_VP_NP_NBar_AdjP.entity) and isa(S_Clause_VP_NP_NBar_AdjP.entity, Red)

Clone this wiki locally