F ====================================================================== FAIL: Doctest: ../../nltk/test/featgram.doctest ---------------------------------------------------------------------- Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 2112, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for ../../nltk/test/featgram.doctest File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 0, in doctest ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 397, in ../../nltk/test/featgram.doctest Failed example: cp = parse.load_earley('grammars/bindop.fcfg', trace=1, chart_class=InstantiateVarsChart) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 2, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 46, in load_earley grammar = nltk.data.load(filename, cache=cache, verbose=verbose) File "/Volumes/Data/nltk/trunk/nltk/nltk/data.py", line 444, in load resource_val = cfg.parse_fcfg(_open(resource_url).read()) File "/Volumes/Data/nltk/trunk/nltk/nltk/cfg.py", line 764, in parse_fcfg (linenum+1, line, e)) ValueError: Unable to parse line 31: S[sem=[core=<(?vp ?subj)>, bo={?b1+?b2}]] -> NP[sem=[core=?subj, bo=?b1]] VP[sem=[core=?vp, bo=?b2]] Error parsing feature structure S[sem=[core=<(?vp ?subj)>, bo={?b1+?b2}]] -> NP[sem=[core=?subj, bo=?b1]] VP[sem=[core=?vp, bo=?b2]] ^ Expected logic expression ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 405, in ../../nltk/test/featgram.doctest Failed example: trees = cp.nbest_parse('john barks'.split()) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 1, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 307, in nbest_parse self._check_lexicon_coverage(tokens) File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 363, in _check_lexicon_coverage "input words: " + missing) ValueError: Grammar does not cover some of the input words: 'john', 'barks' ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 415, in ../../nltk/test/featgram.doctest Failed example: for tree in trees: print tree Differences (unified diff with -expected +actual): @@ -1,4 +1,9 @@ -(S[sem=[bo={bo(\P.P(John),z101)}, core=]] - (NP[sem=[bo={bo(\P.P(John),z101)}, core=]] john) - (VP[sem=[bo={/}, core=<\x.bark(x)>]] - (IV[sem=[bo={/}, core=<\x.bark(x)>]] barks))) +(S[] + (NP[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] + (Det[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] die) + (N[AGR=[GND='fem', NUM='sg', PER=3]] katze)) + (VP[AGR=[NUM='sg', PER=3]] + (TV[AGR=[NUM='sg', PER=3], OBJCASE='acc'] sieht) + (NP[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] + (Det[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] den) + (N[AGR=[GND='masc', NUM='sg', PER=3]] hund)))) ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 423, in ../../nltk/test/featgram.doctest Failed example: trees = cp.nbest_parse('john feeds a dog'.split()) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 1, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 307, in nbest_parse self._check_lexicon_coverage(tokens) File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 363, in _check_lexicon_coverage "input words: " + missing) ValueError: Grammar does not cover some of the input words: 'john', 'feeds', 'a', 'dog' ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 440, in ../../nltk/test/featgram.doctest Failed example: for tree in trees: print tree Differences (unified diff with -expected +actual): @@ -1,7 +1,9 @@ -(S[sem=[bo={bo(\P.P(John),z102), bo(\P.exists x.(dog(x) & P(x)),z103)}, core=]] - (NP[sem=[bo={bo(\P.P(John),z102)}, core=]] john) - (VP[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z103)}, core=<\y.feed(y,z103)>]] - (TV[sem=[bo={/}, core=<\x.\y.feed(y,x)>]] feeds) - (NP[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z103)}, core=]] - (Det[sem=[bo={/}, core=<\Q.\P.exists x.(Q(x) & P(x))>]] a) - (N[sem=[bo={/}, core=]] dog)))) +(S[] + (NP[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] + (Det[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] die) + (N[AGR=[GND='fem', NUM='sg', PER=3]] katze)) + (VP[AGR=[NUM='sg', PER=3]] + (TV[AGR=[NUM='sg', PER=3], OBJCASE='acc'] sieht) + (NP[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] + (Det[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] den) + (N[AGR=[GND='masc', NUM='sg', PER=3]] hund)))) ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 451, in ../../nltk/test/featgram.doctest Failed example: cp = parse.load_earley('grammars/bindop.fcfg', trace=0, chart_class=InstantiateVarsChart) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 2, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 46, in load_earley grammar = nltk.data.load(filename, cache=cache, verbose=verbose) File "/Volumes/Data/nltk/trunk/nltk/nltk/data.py", line 444, in load resource_val = cfg.parse_fcfg(_open(resource_url).read()) File "/Volumes/Data/nltk/trunk/nltk/nltk/cfg.py", line 764, in parse_fcfg (linenum+1, line, e)) ValueError: Unable to parse line 31: S[sem=[core=<(?vp ?subj)>, bo={?b1+?b2}]] -> NP[sem=[core=?subj, bo=?b1]] VP[sem=[core=?vp, bo=?b2]] Error parsing feature structure S[sem=[core=<(?vp ?subj)>, bo={?b1+?b2}]] -> NP[sem=[core=?subj, bo=?b1]] VP[sem=[core=?vp, bo=?b2]] ^ Expected logic expression ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 456, in ../../nltk/test/featgram.doctest Failed example: trees = cp.nbest_parse('john feeds john'.split()) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 1, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 307, in nbest_parse self._check_lexicon_coverage(tokens) File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 363, in _check_lexicon_coverage "input words: " + missing) ValueError: Grammar does not cover some of the input words: 'john', 'feeds', 'john' ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 457, in ../../nltk/test/featgram.doctest Failed example: for tree in trees: print tree Differences (unified diff with -expected +actual): @@ -1,5 +1,9 @@ -(S[sem=[bo={bo(\P.P(John),z104), bo(\P.P(John),z105)}, core=]] - (NP[sem=[bo={bo(\P.P(John),z104)}, core=]] john) - (VP[sem=[bo={bo(\P.P(John),z105)}, core=<\y.feed(y,z105)>]] - (TV[sem=[bo={/}, core=<\x.\y.feed(y,x)>]] feeds) - (NP[sem=[bo={bo(\P.P(John),z105)}, core=]] john))) +(S[] + (NP[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] + (Det[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] die) + (N[AGR=[GND='fem', NUM='sg', PER=3]] katze)) + (VP[AGR=[NUM='sg', PER=3]] + (TV[AGR=[NUM='sg', PER=3], OBJCASE='acc'] sieht) + (NP[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] + (Det[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] den) + (N[AGR=[GND='masc', NUM='sg', PER=3]] hund)))) ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 464, in ../../nltk/test/featgram.doctest Failed example: trees = cp.nbest_parse('a dog feeds a dog'.split()) Exception raised: Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "", line 1, in File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 307, in nbest_parse self._check_lexicon_coverage(tokens) File "/Volumes/Data/nltk/trunk/nltk/nltk/parse/featurechart.py", line 363, in _check_lexicon_coverage "input words: " + missing) ValueError: Grammar does not cover some of the input words: 'a', 'dog', 'feeds', 'a', 'dog' ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/featgram.doctest", line 465, in ../../nltk/test/featgram.doctest Failed example: for tree in trees: print tree Differences (unified diff with -expected +actual): @@ -1,9 +1,9 @@ -(S[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z106), bo(\P.exists x.(dog(x) & P(x)),z107)}, core=]] - (NP[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z106)}, core=]] - (Det[sem=[bo={/}, core=<\Q.\P.exists x.(Q(x) & P(x))>]] a) - (N[sem=[bo={/}, core=]] dog)) - (VP[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z107)}, core=<\y.feed(y,z107)>]] - (TV[sem=[bo={/}, core=<\x.\y.feed(y,x)>]] feeds) - (NP[sem=[bo={bo(\P.exists x.(dog(x) & P(x)),z107)}, core=]] - (Det[sem=[bo={/}, core=<\Q.\P.exists x.(Q(x) & P(x))>]] a) - (N[sem=[bo={/}, core=]] dog)))) +(S[] + (NP[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] + (Det[AGR=[GND='fem', NUM='sg', PER=3], CASE='nom'] die) + (N[AGR=[GND='fem', NUM='sg', PER=3]] katze)) + (VP[AGR=[NUM='sg', PER=3]] + (TV[AGR=[NUM='sg', PER=3], OBJCASE='acc'] sieht) + (NP[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] + (Det[AGR=[GND='masc', NUM='sg', PER=3], CASE='acc'] den) + (N[AGR=[GND='masc', NUM='sg', PER=3]] hund)))) ---------------------------------------------------------------------- Ran 1 test in 9.854s FAILED (failures=1)