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

Created time helper functions #993

Merged
merged 6 commits into from Aug 19, 2014
Merged

Conversation

sebastianruder
Copy link
Contributor

Should not be merged yet.

@amebel
Copy link
Contributor

amebel commented Aug 13, 2014

@sebastianruder will you pls add the example sentences per rule, it makes it easier for testing. And also, add a comment of the outputs on github conversations so as to foster discussion on the knowledge representation.

Thanks

(if (string=? $y_pos "verb")
(PredicateNode $y_instance df-node-stv)
(ConceptNode $y_instance df-node-stv)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a possibility that adjective will also become PredicateNode from #987 because adjective in some case can act like a predicate.

Depends on discussion and whether the change will be approved of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williampma, can you think of an example sentence, where RelEx would produce an adjective in the second argument position in a before or after relation? I can't think of any.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"He sleeps before he is tired." gives me before(sleep, tired) and pos(tired, adj) for parse 1. Other parse # give pos(tire, verb) so I guess it varies.

@williampma
Copy link
Member

If you really want to avoid multiple helper functions for similar rule, you could create:

(define (some-other-named-rule x y word) ...)

and call it like

[BEFORE] {100} <> before(....) .... => (some-other-named-rule x (get-instance... ) ... "before")
[AFTER] {100} <> after(...) ... => (some-other.... "after")

@sebastianruder
Copy link
Contributor Author

@amebel, @williampma, could you review the recent commits? The discussion can be found here while the related commit can be found here.

)
(list
(EvaluationLink df-link-stv
before-or-after-node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could just do (PredicateNode $before_or_after) here, since before-or-after-node seems kind of redundant. Just nitpicking :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @williampma. I totally missed that. :)

@cosmoharrigan
Copy link
Member

@amebel can you please merge this, if it is okay?

(define time-node
(if (string=? $period "am")
(TimeNode $hour df-node-stv)
(TimeNode (number-string (+ (string->number $hour) 12)) df-node-stv)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls change number-string to number->string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it.

amebel added a commit that referenced this pull request Aug 19, 2014
@amebel amebel merged commit 83285d1 into opencog:master Aug 19, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants