Skip to content

Conversation

@dcsan
Copy link

@dcsan dcsan commented Jul 8, 2020

I created a very simple nodeJS demo in response to #78

I used the existing build 0.1.2 from the CDN and just added to the PR

Can you explain your build process to compile all the files down to one to create the built ishml.js ?
Some of the examples just seem to include a ton of extra files, eg
https://github.com/bikibird/ishml/blob/master/examples/cloakofdarkness.html#L43-L59

The actual parser output also isn't always what I would expect...

@dcsan
Copy link
Author

dcsan commented Jul 8, 2020

I added a little README

the parsing isnt' quite what i was expecting, adjectives and nouns seem to get a bit confused:

---
input:	 take the ruby slipper
verb 	 take / take
adj 	 ruby / ring   <= thinks ruby is an adjective but sees 'ring' as the key?
noun 	 slipper / slipper
---
input:	 drop the ring in the tumbler
verb 	 drop / drop
adj 	 undefined /
noun 	 ring / ring

=> is there a way to parse more complex subject + object clauses? perhaps I need to really get into how the grammar part works.

---
input:	 put on the ring
verb 	 put on / wear
adj 	 undefined /
noun 	 ring / ring
---
input:	 take the glass
verb 	 take / take
adj 	 undefined /
noun 	 glass / slipper   => glass should be a noun/tumbler not glass adj. 
---
input:	 take the tumbler
verb 	 take / take
adj 	 undefined /
noun 	 tumbler / tumbler
---
input:	 take the glass slipper
verb 	 take / take
adj 	 glass / slipper
noun 	 slipper / slipper

adj is defined as

logit('adj', int.nounPhrase.adjectives ? int.nounPhrase.adjectives[0] : '') // just first one

@bikibird
Copy link
Owner

What you are missing is a semantics function defined on the nounPhrase to filter out mismatches between adjectives and nouns. Reread the section on semantics in the tutorial https://whitewhalestories.com/tutorials/parsing2.html and try adding a semantics function.

My build file is here: https://github.com/bikibird/ishml/blob/master/.vscode/tasks.json

Only the files listed in tasks.json should be considered the official ISHML.

All the other files in this repository (including the cloak of darkness files) are still under development and will be subject to a great deal of revision. My development process is try out a whole bunch of ideas and throw out the ones that turn out bad. That results in a lot of code that will eventually be deleted. Consider yourself warned. (You can count on the files in tasks.json remaining, though.)

It's neat that you are working and testing in Node. I'm pretty ignorant when it comes to the server side of things.

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.

2 participants