示例#1
0
 except (EOFError, KeyboardInterrupt):
     break
 if typed == 'q':
     break
 elif typed == 'h':
     print(format_help())
 else:
     text = convert_ascii(typed)
     print(text)
     for word in text.split():
         word = word.strip()
         if word == '':
             continue
         print()
         print('"{}"'.format(word))
         deconstruction = deconstruct_formative(word)
         if deconstruction is None:
             print('???')
         else:
             for slot, value, meaning in deconstruction:
                 if value == '':
                     print('  {} empty'.format(slot))
                 else:
                     print('  {} = {}'.format(slot, value))
                 if slot == 'Cr':
                     print('    "{}"'.format(meaning))
                 else:
                     for abbr in meaning:
                         desc = abbreviation_table[abbr]
                         print('    {} : {}'.format(abbr, desc))
 print()
示例#2
0
 except (EOFError, KeyboardInterrupt):
     break
 if typed == 'q':
     break
 elif typed == 'h':
     print(format_help())
 else:
     text = convert_ascii(typed)
     print(text)
     for word in text.split():
         word = word.strip()
         if word == '':
             continue
         print()
         print('"{}"'.format(word))
         deconstruction = deconstruct_formative(word)
         if deconstruction is None:
             print('???')
         else:
             for slot, value, meaning in deconstruction:
                 if value == '':
                     print('  {} empty'.format(slot))
                 else:
                     print('  {} = {}'.format(slot, value))
                 if slot == 'Cr':
                     print('    "{}"'.format(meaning))
                 else:
                     for abbr in meaning:
                         desc = abbreviation_table[abbr]
                         print('    {} : {}'.format(abbr, desc))
 print()
示例#3
0
 def test(word):
     assert_equal(
         deconstruct_formative(word),
         target,
     )