singnet / opencog

A framework for integrated Artificial Intelligence & Artificial General Intelligence (AGI)
http://wiki.opencog.org/w/Development
Other
15 stars 3 forks source link

Ghost-consequently put optionals and wildcard prevent parsing #34

Closed bulidiriba closed 5 years ago

bulidiriba commented 5 years ago

Recreated from opencog #3268

guile> (ghost-parse "u: (define {meaning definition} of *) I don't know ^keep")

guile> (ghost-run)
#<thread 139639698298624 (1541380)>

guile> (ghost "define meaning of love")
(SentenceNode "sentence@6e777972-eba5-4d79-9cb2-2e28aed9def9")

guile> (ghost-get-result)
((WordNode "I")
 (WordNode "don't")
 (WordNode "know")
)
guile>

The above work perfectly since they are not consequent(there is word "of" in between) but the ff doesn't work

guile> (ghost-parse "u: (define {word idea} *) I dont know ^keep")

guile> (ghost "define word love")
(SentenceNode "sentence@8a8a3f39-6814-4e39-8d5f-53a091689e2e")

guile> (ghost-get-result)
()
guile>
leungmanhin commented 5 years ago

I'm confused by the pattern, (define {word idea} *) means the word "define" is needed, followed by either "word", "idea", or nothing, as they are optional, and then a wildcard at the end which can be nothing or anything, so essentially the pattern is (define *)?

leungmanhin commented 5 years ago

Anyway the rule should be triggered in the above example, https://github.com/singnet/opencog/pull/35 should fix it

bulidiriba commented 5 years ago

yeah its solved by #35

bulidiriba commented 5 years ago

actually as you mention both pattern are the same, (define {word idea} ) is the same to (define ) however before its solved by #35, The 1st pattern couldn't handled by ghost but now solved