Ok, so I am having some challenges detecting if a word is a noun. I have created a test pattern to illustrate different results with different methods of testing if a word is a noun:
u: (is {a} _*1 a noun) ^noerase() ^repeat()
if (_0 ? ~NOUN) {1. yes \n} else {1. no \n}
if (_0 ? ~NOUNS) {2. yes \n} else {2. no \n}
if (_0 ? ~noun) {3. yes \n} else {3. no \n}
if (_0 ? ~nouns) {4. yes \n} else {4. no \n}
if (^HASPROPERTY(_0 NOUN)) {5. yes} else {5. no}
results:
alaric:_> is a corner a noun?
HARRY:_ 1. yes
2. no
3. yes
4. no
5. yes
alaric:_> is a car a noun?
HARRY:_ 1. yes
2. yes
3. yes
4. yes
5. yes
alaric:_> is driving a noun?
HARRY:_ 1. no
2. no
3. no
4. no
5. yes
Why are the results different? Are the concepts built from the WordNet dictionary definitions or are they different? Where are the concepts defined that are created when you run :build0?
What is the difference between ~NOUN and ~NOUNS?
I know that you said Part of Speech (POS) tagging was a work in progress. I tried :SHOW POS and it showed some interesting tags but not a tag for each word in the sentence. I would like to try “parsing” a sentence to build rules when the input sentence contains “If” and “then”. I have the logic to burst and loop through each word but I am getting some inconsistent results when testing and flagging nouns as shown above. What is the best way to tell if a word in a variable might be a noun (nouns can be used as adjectives so I realize that context will need to be considered eventually)?
Thanks.