<s> """<STR_LIT>""" <EOL> from refo import Question , Plus <EOL> from dsl import DefinitionOf , NameOf , LocationOf <EOL> from quepy . dsl import HasKeyword <EOL> from quepy . parsing import QuestionTemplate , Particle , Lemma , Pos , Lemmas <EOL> class Thing ( Particle ) : <EOL> regex = Plus ( Question ( Pos ( "<STR_LIT>" ) ) + ( Pos ( "<STR_LIT>" ) | Pos ( "<STR_LIT>" ) | Pos ( "<STR_LIT>" ) ) | <EOL> Pos ( "<STR_LIT>" ) ) <EOL> def interpret ( self , match ) : <EOL> return HasKeyword ( match . words . tokens ) <EOL> class WhatIs ( QuestionTemplate ) : <EOL> """<STR_LIT>""" <EOL> regex = Lemma ( "<STR_LIT>" ) + Lemma ( "<STR_LIT>" ) + Question ( Pos ( "<STR_LIT>" ) ) + Thing ( ) + Question ( Pos ( "<STR_LIT:.>" ) ) <EOL> def interpret ( self , match ) : <EOL> label = DefinitionOf ( match . thing ) <EOL> return label <EOL> class WhereIsQuestion ( QuestionTemplate ) : <EOL> """<STR_LIT>""" <EOL> regex = Lemma ( "<STR_LIT>" ) + Question ( Lemmas ( "<STR_LIT>" ) ) + Lemma ( "<STR_LIT>" ) + Question ( Pos ( "<STR_LIT>" ) ) + Thing ( ) + Question ( Pos ( "<STR_LIT:.>" ) ) <EOL> def interpret ( self , match ) : <EOL> location = LocationOf ( match . thing ) <EOL> location_name = NameOf ( location ) <EOL> return location_name </s>
