Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClipsPy empty Error #39

Closed
angel-langdon opened this issue Oct 30, 2020 · 2 comments
Closed

ClipsPy empty Error #39

angel-langdon opened this issue Oct 30, 2020 · 2 comments

Comments

@angel-langdon
Copy link

angel-langdon commented Oct 30, 2020

I am new to CLIPS and to clipsPy. I am trying to create a instance of a CLIPS class

This is the class I have defined and correctly build in my python environment (clipsPy)

ENTITIES_CLASS = """
(defclass ENTITY-CLASS (is-a INITIAL-OBJECT)
    (slot text (type STRING))
    (slot confidence (type FLOAT))
    (slot type (type SYMBOL))
)
"""
env.build(ENTITIES_CLASS)

This works as expected, but when I try to create an instance of this class:

new_instance = "(ent0-0 of ENTITY-CLASS (text 'Bruce Springsteen')(confidence 1.0)(type PER))"
env.make_instance( new_instance )

I get this empty error:

https://i.stack.imgur.com/rLTZY.png

I have tried multiple forms of building the new_instance string but none have work :

new_instance = '(ent0-0 of ENTITY-CLASS (text "Bruce Springsteen")(confidence 1.0)(type PER))'
new_instance = "(ent0-0 of ENTITY-CLASS (text 'Bruce Springsteen') (confidence 1.0) (type PER) )"

Where is my syntax error? I appreciate any help

@angel-langdon
Copy link
Author

I restarted Jupyter Notebook and used double quotes for large strings with spaces and it worked:
new_instance = '(ent0-0 of ENTITY-CLASS (text "Bruce Springsteen")(confidence 1.0)(type PER))'

@noxdafox
Copy link
Owner

Issue discussed in this StackOverflow question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants