F ====================================================================== FAIL: Doctest: ../../nltk/test/discourse.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/discourse.doctest File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 0, in doctest ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 16, in ../../nltk/test/discourse.doctest Failed example: dt = DiscourseTester(['a boxer walks', 'every boxer chases a girl']) 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/inference/discourse.py", line 81, in __init__ self._parser = parse.load_earley(self._gramfile) 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 25: NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' Error parsing feature structure NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' ^ Expected logic expression ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 23, in ../../nltk/test/discourse.doctest Failed example: dt.sentences() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 31, in ../../nltk/test/discourse.doctest Failed example: dt.grammar() # doctest: +ELLIPSIS 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 52, in ../../nltk/test/discourse.doctest Failed example: dt.readings() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 75, in ../../nltk/test/discourse.doctest Failed example: dt.readings('a boxer walks') 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 87, in ../../nltk/test/discourse.doctest Failed example: dt.readings(threaded=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 106, in ../../nltk/test/discourse.doctest Failed example: dt.models('d1') 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 164, in ../../nltk/test/discourse.doctest Failed example: dt.add_sentence('John is a boxer') 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 165, in ../../nltk/test/discourse.doctest Failed example: dt.sentences() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 173, in ../../nltk/test/discourse.doctest Failed example: dt.readings() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 189, in ../../nltk/test/discourse.doctest Failed example: dt.readings(threaded=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 202, in ../../nltk/test/discourse.doctest Failed example: thread = dt.expand_threads('d6') 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 203, in ../../nltk/test/discourse.doctest Failed example: for rid, reading in thread: print rid, str(reading) 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 NameError: name 'thread' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 211, in ../../nltk/test/discourse.doctest Failed example: dt = DiscourseTester(['A student dances', 'Every student is a person']) 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/inference/discourse.py", line 81, in __init__ self._parser = parse.load_earley(self._gramfile) 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 25: NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' Error parsing feature structure NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' ^ Expected logic expression ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 217, in ../../nltk/test/discourse.doctest Failed example: dt.add_sentence('No person dances', consistchk=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 223, in ../../nltk/test/discourse.doctest Failed example: dt.readings() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 239, in ../../nltk/test/discourse.doctest Failed example: dt.retract_sentence('No person dances', quiet=False) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 246, in ../../nltk/test/discourse.doctest Failed example: dt.models() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 279, in ../../nltk/test/discourse.doctest Failed example: dt.add_sentence('A person dances', informchk=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 286, in ../../nltk/test/discourse.doctest Failed example: dt.models() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 321, in ../../nltk/test/discourse.doctest Failed example: dt = DiscourseTester(['Vincent is a boxer', 'Fido is a boxer', 'Vincent is married', 'Fido barks']) 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/inference/discourse.py", line 81, in __init__ self._parser = parse.load_earley(self._gramfile) 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 25: NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' Error parsing feature structure NP[-loc,num=sg,sem=<\Q. (not some x. ((person x) and (Q x)))>] -> 'nobody' | 'Nobody' ^ Expected logic expression ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 322, in ../../nltk/test/discourse.doctest Failed example: dt.readings() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 344, in ../../nltk/test/discourse.doctest Failed example: dt.readings(threaded=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 355, in ../../nltk/test/discourse.doctest Failed example: bg = nltk.data.load('grammars/background1.fol') 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/data.py", line 446, in load resource_val = sem.parse_fol(_open(resource_url).read()) File "/Volumes/Data/nltk/trunk/nltk/nltk/sem/util.py", line 187, in parse_fol raise ValueError, 'Unable to parse line %s: %s' % (linenum, line) ValueError: Unable to parse line 11: all x. ((boxerdog x) implies (dog x)) ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 356, in ../../nltk/test/discourse.doctest Failed example: dt.add_background(bg) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 357, in ../../nltk/test/discourse.doctest Failed example: dt.background() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 372, in ../../nltk/test/discourse.doctest Failed example: dt.readings(filter=True) 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 377, in ../../nltk/test/discourse.doctest Failed example: dt.models() 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 NameError: name 'dt' is not defined ---------------------------------------------------------------------- File "/Volumes/Data/nltk/trunk/nltk/nltk/test/discourse.doctest", line 487, in ../../nltk/test/discourse.doctest Failed example: mybg = parse_fol(open('background1.fol').read()) 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/inference/discourse.py", line 397, in parse_fol except Error: NameError: global name 'Error' is not defined ---------------------------------------------------------------------- Ran 1 test in 6.191s FAILED (failures=1)