superscriptjs / superscript

A dialogue engine for creating chat bots
http://superscriptjs.com
MIT License
1.65k stars 209 forks source link

A little error in documentation #387

Open dufia opened 6 years ago

dufia commented 6 years ago

I am just trying out the SuperScript and it is looking excellent so far.

I am following the docs and I found a little error here https://github.com/superscriptjs/superscript/wiki/Triggers#wordnet-expansion

+ I ~like ~sport
Matches I like hockey
Matches I love baseball
Matches I care for soccer
Matches I prefer lacrosse

This example won't work. I thought something went wrong with the WordNet but it is working correctly. It just doesn't have hockey or baseball in its database.

From data.json

            "trigger": {
                "flags": {},
                "filter": null,
                "question": false,
                "raw": "I ~like ~sport",
                "clean": "I(?=^|\\s)\\s*(please|cotton|prefer|care for|love|like)(?=\\s|$)\\s*(?=^|\\s)\\s*(funambulism|rock climbing|contact sport|outdoor sport|gymnastics|track and field|skiing|water sport|rowing|archery|sledding|skating|racing|riding|cycling|blood sport|athletic game|judo|spectator sport|team sport|professional boxing|professional wrestling|sumo|professional golf|professional football|professional baseball|professional basketball|professional tennis|freak|jocosity|waggery|drollery|pun|sport)(?=\\s|$)\\s*"
            },

It seems a little weird that you have stuff like professional golf but not football for example. I mean there is professional football but no one talks like that. Right?

MaffooBristol commented 5 years ago

I agree that the dictionary system is a bit wacky in SS. I wonder if there's an easy way to replace it with a custom one?

I cotton blood sport matches I like football does not...

🙃

MaffooBristol commented 5 years ago

For anyone curious, because I didn't know how to do it the other day, you can add in your own facts/concepts and it will replace the ones coming from wordnet:

mkdir concepts && echo "concept: ~sport ( football rugby snooker tennis )" > concepts/concepts.top
parse --facts concepts/concepts.top

I do wonder whether it'd be good to have superscript provide default overrides for the stranger of the wordnet concepts. Within the tests for sfacts, there is a concept file which seems to be a modified version of the one from ChatScript (correct me if I'm wrong) - https://github.com/superscriptjs/sfacts/blob/master/test/data/concepts.top

It is a little odd what's coming out of wordnet as I thought it was meant to be the de-facto dictionary system, so maybe one to think about?