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:

"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) and
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