#140 FishermanLicenseQuiz npc should parse string for match name

closed-fixed
nobody
None
5
2011-03-26
2010-04-24
yoriy
No

I offer to use regular expressions for matching fish name in given by player string, so Santiago could accept "stripped clownfish" for example

Discussion

  • Martin Fuchs

    Martin Fuchs - 2010-12-30

    We could introduce using regular expressions in the license quiz. We could also simply look for a substring match in the user input like with this code:
    if (sentence.getOriginal().toLowerCase().contains(getCurrentSpecies()) {
    ... // match found
    }

    What I would prefer is to use the NPC parser functionality to recognize word types. So you can use this code to search for a matching answer:

    if (sentence.getObjectName().contains(getCurrentSpecies()) {
    ... // match found
    }

    This would also catch your example.

     
  • Martin Fuchs

    Martin Fuchs - 2011-03-26

    Thanks for the idea. The behavior in CVS is now more user friendly.

     
  • Martin Fuchs

    Martin Fuchs - 2011-03-26
    • status: open --> closed-fixed
     


Anonymous

Cancel  Add attachments