def demo_legacy_grammar():
 from nltk.grammar import FeatureGrammar
 g = FeatureGrammar.fromstring(u"\n    % start S\n    S[sem=<hello>] -> 'hello'\n    ")
 print((u'Reading grammar: %s' % g))
 print((u'*' * 20))
 for reading in interpret_sents([u'hello'], g, semkey=u'sem'):
  (syn, sem) = reading[0]
  print()
  print(u'output: ', sem)

def demo_legacy_grammar ( ) : from nltk . grammar import FeatureGrammar g = FeatureGrammar . fromstring ( u"\n    % start S\n    S[sem=<hello>] -> 'hello'\n    " ) print ( ( u'Reading grammar: %s' % g ) ) print ( ( u'*' * 20 ) ) for reading in interpret_sents ( [ u'hello' ] , g , semkey = u'sem' ) : ( syn , sem ) = reading [ 0 ] print ( ) print ( u'output: ' , sem )
check that interpret_sents() is compatible with legacy grammars that use a lowercase sem feature .