/pmb-generator

Generate Hindi sentences from customised PMB sbn annotation files

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pmb-generator

Generate Hindi sentences from customised PMB sbn annotation files

#To see the data structure:

    python3 pmb-ds.py sen_1_mod

    0_n ('quantity.n.01', (('EQU', '1'),), '')
    1_n ('male.n.02', (), '')
    2_v ('give.v.03', (('Agent#karwA', '-1'), ('A_TAM', '+1'), ('Time', '+2'), ('Recipient#saMpraxAna', '+3'), ('Theme#karma', '+4')), '')
    3_A_TAM ('A_TAM', 'ed#yA_hE', '')
    4_n ('time.n.08', (('TPR', 'now'),), '')
    5_n ('quantity.n.01', (('EQU', '1'),), '')
    6_n ('person.n.01', (('EQU', 'speaker'),), '')
    7_n ('quantity.n.01', (('EQU', '1'),), '')
    8_n ('watch.n.01', (), '')

#For running with python debugger.

    Python -m pdb pmb-ds.py sen_1_mod

    Set the break point at specific line

    b 161

    Continue upto the breakpoint

    c

    For going to next line press 'n'

    For stepping into a function press 's'

    For printing the data structure 'pmb_ds'

#Running the nested Tuple program

This is a sample program to demonstrate how to make nested tuple from the pmb rows.

 python make_nested_tuple.py
Input Tuple:  ('give.v.03', 'Agent#karwA', '-1', 'TAM#A_TAM', '+1', 'TIME#Time', '+2', 'Recipient#saMpraxAna', '+3', 'Theme#karma', '+4')
Nested Tuple: {'1': 3, '2': 4, '3': 5, '4': 6, '5': 7, '6': 8}
('give.v.03', ('Agent#karwA', '-1'), ('TAM#A_TAM', '+1'), ('TIME#Time', '+2'), ('Recipient#saMpraxAna', '+3'), ('Theme#karma', '+4'), ())