cannot get graphic representaion using Visc

Help
2010-06-01
2013-04-08
  • Hi Everybody,

    I am currently following the tutorial under http://comp.ling.utexas.edu/wiki/doku.php/openccg/ccggui_tut step by step. ( It deals with about how to write grammar for OpenCCG.)
    In a section it is said that after entering a "lexical family", one shoul be able to show its graphic representaion by clicking on the tab "lexicon". But this does not work for me.
    I can write a lexical family but when I click on the tab "lexicon", I do not get the graphic representation of the newly created lexical Family: the window rather remains grey and no matter if I check out the options boxes (of the "lexicon" tab). On the console I also have following error message:

    ValueError: Expected a string
    Exception in Tkinter callback
    Traceback (most recent call last):
      File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
        return self.func(*args)
      File "/myhomedir/software/openccg/bin/ccg_editor.py", line 485, in redraw
        self.cfile.compile_if_needed()
      File "/myhomedir/software/openccg/bin/ccg_editor.py", line 1317, in compile_if_needed
        self.curparse = ccg2xml.parse_string(text)
      File "/myhomedir/software/openccg/bin/ccg2xml.py", line 3309, in parse_string
        retval.parse = yacc.parse(str, lexer=MacroLexer(globallexer))
      File "/myhomedir/software/openccg/bin/yacc.py", line 181, in parse
        lexer.input(input)
      File "/myhomedir/software/openccg/bin/ccg2xml.py", line 3149, in input
        self.lexer.input(s)
      File "/myhomedir/software/openccg/bin/lex.py", line 255, in input
        raise ValueError, "Expected a string"
    ValueError: Expected a string

    Does anybody knows what the problem could be. Thanks you in advance.
    Regards, Abou.

     

  • Anonymous
    2013-04-01

    Hi,
    The problem is in the lex.py package. You have to change the following comparision.

    if not isinstance(s,types.StringType):
                raise ValueError, "Expected a string"

    ==>

    if not isinstance(s,types.StringTypes):
                raise ValueError, "Expected a string"

    Note that types.StringType ==> types.StringTypes