How to test NPC Parser: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
imported>MartinFuchs
mNo edit summary
Line 11: Line 11:




You can launch the dialog with the script "runpte.sh" on Unix/Mac and with "runbte.bat" on windows. This will compile the server and tools part, then launch the Java dialog. It may be even easier or you to run it directly from Eclipse by launching the class games.stendhal.tools.npcparsertestenv.TestEnvDlg .
You can launch the dialog with the script "runpte.sh" on Unix/MacOS and with "runbte.bat" on windows. This will compile the server and tools part, then launch the Java dialog. It may be even easier or you to run it directly from Eclipse by launching the class games.stendhal.tools.npcparsertestenv.TestEnvDlg .


The dialog displays how the conversation parser interprets user input and gives a hint about not yet known words. You can choose one of the predefined example sentences or write your own text into the input field. This way you can design the NPC conversations and test how the parser reacts on user input. You can see how the parser interprets the text, recognizes the words and merges them to longer expressions. Each expression is assigned an expression type like OBJect, SUBject, VERb or ADJective. If the parser discovers any unknown words, the surrounding expression is displayed in red color. You should add these new words to the word list "words.txt", located in the package "games.stendhal.server.entity.npc.parser" .
The dialog displays how the conversation parser interprets user input and gives a hint about not yet known words. You can choose one of the predefined example sentences or write your own text into the input field. This way you can design the NPC conversations and test how the parser reacts on user input. You can see how the parser interprets the text, recognizes the words and merges them to longer expressions. Each expression is assigned an expression type like OBJect, SUBject, VERb or ADJective. If the parser discovers any unknown words, the surrounding expression is displayed in red color. You should add these new words to the word list "words.txt", located in the package "games.stendhal.server.entity.npc.parser" .
Line 26: Line 26:
if you use exact matching, it does not match:
if you use exact matching, it does not match:


* Standard matching compares the normalized expressions (not looking at concrete item numbers for example).
* Standard expression matching compares the normalized expressions (not looking at concrete item numbers for example).
* Controlled matching allows to specify the matching type by leading type flags like "|JOKER|", "|SIMILAR|" or "|EXACT|ICASE|".
* Joker matching allows to use "*" wildcards as placeholder for arbitrary expressions.
* Joker matching allows to use "*" wildcards as placeholder for arbitrary expressions.
* Exact matching only matches sentences if all of the expressions in the sentence exactly match them in the match string.
* Exact matching only matches sentences if all of the expressions in the sentence exactly match them in the match string.