-
Thanks for setting this up! From my time using ishml, I generally understood the concepts and wanted to use it for a basic parser for a text adventure game. It would need to understand basic sentences such:
basically
then things could get a bit more complex with But I got stuck at actually writing the grammar doc to parse these type of things and just reverted to regex. I would need to specify each possible noun $item separately, is that correct? use A on B then A and B can come back as the result My comparison for this is how DialogFlow and other NLP tools work So basically a helpful addition to the library would be a bundled example grammar for basic text adventure type command parsing. previous discussion:
seemed really complex setup process compared to a regex with matching. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You're welcome! GitHub Discussions are in beta, but hopefully they are here to stay. Yes, I'm working on a real parser for text adventures. Once I get that done it should be more obvious how to connect code to the lexicon. Feel free to ask about my progress in about a month's time. You can take a look at https://github.com/bikibird/ishml/blob/master/extensions/lang.js if you are curious, but this is still very much a work in progress and I don't stand by any of it. I got a bit side-tracked for a few months when I decided to add a text generation system. Haven't gotten much in the way of feedback on this component, but I'm still excited about it. So, ISHML does require all synonyms to be added to the lexicon manually. The example you referenced includes multiple synonyms for the "take" key word. You can register a whole batch of synonyms in one line of code. I do eventually plan to release a starter kit which will include a parser, standard actions, and other goodies. With regard to https://intfiction.org/t/ishml-new-javascript-library-for-parser-if/41797/33. I think I have to take back what I said. I had made some changes to the code to make things work more simply, but I neglected to update the examples in the tutorial. Once I realized that, I updated the tutorials, but I think I might not have closed the loop and gotten back to you. Please accept my apologies. Anyhow, you should find that the examples are winnowing down the possible interpretations in a more reasonable way now. |
Beta Was this translation helpful? Give feedback.
-
yes I think when I tried your suggestion it didn't work for me and I assumed I was doing something wrong but didn't solve it, hence no reply on that thread. leaving aside the synonyms for individual words - nouns or verbs - which are easy enough to add, is there a basic grammar example for the main sentence structures like the above, and perhaps something a bit more sophisticated? it's very easy to do a So working code for the simple case, and then some explanation of the benefits over regex I think would help this package get more adoption. ( text generation is a separate topic ) |
Beta Was this translation helpful? Give feedback.
-
PS I think using browser examples also hurts adoption, as there's some setup of a web page etc. |
Beta Was this translation helpful? Give feedback.
You're welcome! GitHub Discussions are in beta, but hopefully they are here to stay.
Yes, I'm working on a real parser for text adventures. Once I get that done it should be more obvious how to connect code to the lexicon. Feel free to ask about my progress in about a month's time. You can take a look at https://github.com/bikibird/ishml/blob/master/extensions/lang.js if you are curious, but this is still very much a work in progress and I don't stand by any of it.
I got a bit side-tracked for a few months when I decided to add a text generation system. Haven't gotten much in the way of feedback on this component, but I'm still excited about it.
So, ISHML does require all synonyms to be …