april 25, 2009 11:07am

Psudeo-code message parser

Learning

notion lives in
notion is a
notion is reverse of

john lives in manchester
john lives in england
john is a person
sophie is a person
machester is a city
coventry is a city
people is plural of person
cities is plural of city
lives is plural of live
is plural of is reverse of is singular of
that is a pronoun
who is a pronoun
who describes a person

list people that live in cities

Processing
features: look ahead, predictive search, joining of unknown terms, flattening sequences of notions based on predictive search, storing triples


command: notion(lives, in)
command: notion(is, a)
command: notion(is, reverse, of)
[john]:unknown, lives (lives in?), [lives in]:notion, [manchester]:unknown
	Normalize([john]:notion, [lives in]:notion, [manchester]:notion)
	(Length == 3) triple(john, lives in, manchester)
[john]:notion, is (is a?), [is a]:notion, [person]:unknown
	Normalize([john]:notion, [is a]:notion, [person]:notion)
	(Length == 3) triple(john, is a, person)
[manchester]:notion, is (is a?), [is a]:notion, [city]:unknown
	Normalize([manchester]:notion, [is a]:notion, [city]:notion)
	(Length == 3) triple(manchester, is a, city)
[people]:unknown, is (is a?) [is]:unknown, [plural]:unknown, [of]:unknown, [person]:notion
	Normalize([people]:notion, [is plural of]:notion, [person]:notion)
	(Length == 3) triple(people, is plural of, person)
[cities]:unknown, is (is a?, is plural of?) [is plural of]:notion, [city]:notion
	Normalize([cities]:notion, [is plural of]:notion, [city]:notion)
	(Length == 3) triple(cities, is plural of, city)
lives (lives in?) [lives]:unknown, is (is a?, is plural of?) [is plural of]:notion, [live]:unknown
	Normalize([lives]:notion, [is plural of]:notion, [live]:notion)
is (is a? is plural of?) [is plural of]:notion, is (is a?, is plural?, is reverse of?) [is reverse of]:notion, is (is a?, is plural?, is reverse of?) [is]:unknown, [singular]:unknown, [of]:unknown)
	Normalize([is plural of]:notion, [is reverse of]:notion, [is singular of]:notion)
	(Length == 3) triple(is plural of, is reverse of, is singular of)
[that]:unknown, is (is a?) [is a]:notion, [pronoun]:unknown
	Normalize([that]:notion, [is a]:notion, [pronoun]:notion)
	(Length == 3) triple(that, is a, pronoun)
[who]:unknown, is (is a?) [is a]:notion, [pronoun]:notion
	Normalize([who]:notion, [is a]:notion, [pronoun]:notion)
	(Length == 3) triple(who, is a, pronoun)
[who]:notion, [describes]:unknown, [a]:unknown, [person]:notion
	Normalize([who]:notion, [describes a]:notion, [person]:notion)
	(Length == 3) triple(who, describes a, person)

command: list([people that live in cities]:string)
[people]:notion
  people -> is plural of -> person
   john -> is a -> person (X)
[that]:notion
  that -> is a -> pronoun
   who -> is a -> pronoun (X)
[live]:notion
  live <- is plural <- lives
[in]:unknown
 in ? no result
 live (lives?) (lives in?) [live in]:notion
  john <- lives in <- manchester
[cities]:notion
  cities -> is plural of -> city

list(is a, people)
  0 results

list(is a, person)
  john <- is a <- person
  sophie <- is a <- person

list(is a, that)
  0 results

/* troublesome:
list(is a, pronoun)
  that <- is a <- pronoun
  who <- is a <- pronoun
*/

list(is a, cities)
  0 results

list(is a, city)
  manchester <- is a <- city
  coventry <- is a <- city

list(lives in)
  john <- lives in <- manchester
  john <- lives in <- england

match(john, manchester, john <- lives in <- manchester) (TRUE)
match(sophie, manchester, ?)
match(john, coventry, ?)
match(sophie, coventry, ?)

Posted By: Markavian

0 comments | Comments