Wednesday 21 January 2015

Automatic Word Type Detection in English



My LANGANA-E English parser making effort is continuing.  Currently I can take a single or a group of sentences from KANDEL's 'The Principles of Neural Science' and analyse each of its words in terms of type.




The analysis is made firstly using an in-memory array reference that lists each type of word, namely pronouns list, irregular words list etc.  Secondly the word type is taken from Webster dictionary(ver. 1910).




The example is sentence 116 at KANDEL' book:




Preface
The goal of neural science is to understand the mind.




As seen below, items coming in-memory word lists by type begin with a + sign.  Webster dictionary based types are listed as they are.




of
           ==>||+prep.||prep.



indicates both in-memory word list for prepositions and webster gives the same result.




I intend to use the memory list when things are easy to decide and Webster for more complex situations.




The next step is to decide :
1- nouns
2- adjectives
3- compound nouns
4- noun phrases
5- verbs
6- adverbs
7- noun clauses
8- subject detection
9- object detection




EXAMPLE OUTPUT:
run:
Sentence=116-------------------------------------------------------------->
Preface
           ==>||n.||v. t.||imp. & p. p. Prefaced||p. pr. & vb. n. Prefacing||v. i.
The
           ==>||+def. art.||v. i.||adv.
goal
           ==>||n.
of
           ==>||+prep.||prep.
neural
           ==>||a.
science
           ==>||n.||v. t.
is
           ==>||+reg. v.||v. i.
to
           ==>||+prep.||prep.
understand
           ==>||irreg. v. neutral||v. t.||imp. & p. p. Understood||p. pr. & vb. n. Understanding||v. i.
the
           ==>||+def. art.||v. i.||adv.
mind
           ==>||n.||v. t.||imp. & p. p. Minded||p. pr. & vb. n. Minding||v. i.
Preface
The goal of neural science is to understand the mind?
BUILD SUCCESSFUL (total time: 3 seconds)