singnet / opencog

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

Ghost - Numbers inside contexts cause errors while parsing. #32

Closed Brook4846 closed 5 years ago

Brook4846 commented 5 years ago

Recreated from opecog #3267

guile> (ghost-parse "u: (Its 5pm) good timing!")

Backtrace:
           8 (apply-smob/1 #<catch-closure 21ed060>)
           7 (apply-smob/1 #<catch-closure 1e149c0>)
In ice-9/boot-9.scm:
   2312:4  6 (save-module-excursion #<procedure 21ef860 at ice-9/eva…>)
In ice-9/eval-string.scm:
     38:6  5 (read-and-eval #<input: string 21dd5b0> #:lang _)
In opencog/ghost.scm:
    264:2  4 (ghost-parse _)
In system/base/lalr.upstream.scm:
  1930:25  3 (_ _ _)
In unknown file:
           2 (scm-error misc-error #f "~A ~S" ("Syntax error: un…" …) …)
In ice-9/boot-9.scm:
   751:25  1 (dispatch-exception 0 misc-error (#f "~A ~S" ("Sy…" …) …))
In unknown file:
           0 (apply-smob/1 #<catch-closure 1e148a0> misc-error #f "…" …)

ERROR: In procedure apply-smob/1:
Syntax error: unexpected token :  #<lexical-token category: NUM source: #<source-location input: #f line: 0 column: 7 offset: 24 length: #f> value: "5">
ABORT: misc-error

While numbers in the middle or at the end of a word in a context (as opposed to numbers that come at the beginning of a word or alone) execute well.

guile> (ghost-parse "u: (how much is4846) Too much.") guile> (ghost "how much is4846") (SentenceNode "sentence@d9dd958b-3842-4084-b44b-b880ec7ea2e8") guile> (ghost-run) guile> (ghost-get-result) ((WordNode "Too") (WordNode "much") (WordNode ".") )

leungmanhin commented 5 years ago

I may have broke it accidentally at some point, should now be fixed in https://github.com/singnet/opencog/pull/33

Brook4846 commented 5 years ago

33 Solves it indeed.