Package parser_course :: Package small_parsers :: Module small_parser
[hide private]
[frames] | no frames]

Module small_parser

source code

Classes [hide private]
  SmallParser
Class providing general methods for a modest class of chart parsers.
Functions [hide private]
 
cross_multiply(ListList)
Returns cross-product of the lists in ListList:
source code
 
list_to_tree(input) source code
Variables [hide private]
  hdr = '\n\\documentclass{article}\n\\usepackage{qtree}\n\\usep...
  pre_filler = '\n\\vspace{.1in}\n\\begin{tabular}[t]{@{}l}\nPar...
  post_filler = '\n}\n\\end{tabular}\n%\\newpage\n\n'
  end = '\n\\end{landscape}\n\\end{document}\n'
Function Details [hide private]

cross_multiply(ListList)

source code 

Returns cross-product of the lists in ListList:

>>> cross_multiply([['a','b','c'],[1,2],['x','y','z']])
[['a', 1, 'x'], ['b', 1, 'x'], ['c', 1, 'x'],
['a', 2, 'x'], ['b', 2, 'x'], ['c', 2, 'x'],
['a', 1, 'y'], ['b', 1, 'y'], ['c', 1, 'y'],
['a', 2, 'y'], ['b', 2, 'y'], ['c', 2, 'y'],
['a', 1, 'z'], ['b', 1, 'z'], ['c', 1, 'z'],
['a', 2, 'z'], ['b', 2, 'z'], ['c', 2, 'z']]

Variables Details [hide private]

hdr

Value:
'''
\\documentclass{article}
\\usepackage{qtree}
\\usepackage{array}
\\usepackage{graphics}
\\usepackage{lscape}
\\setlength{\\textwidth}{8in}

...

pre_filler

Value:
'''
\\vspace{.1in}
\\begin{tabular}[t]{@{}l}
Parse %d\\\\
\\hskip -3.0in
\\scalebox{%.2f}{
'''