Skip to content

Commit

Permalink
RTXteam#316 tui combo mapping converter
Browse files Browse the repository at this point in the history
  • Loading branch information
ecwood committed Sep 13, 2023
1 parent b31aa48 commit d4c7e49
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions misc-tools/tui_combo_mappings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
__author__ = 'Erica Wood'
__copyright__ = 'Oregon State University'
__credits__ = ['Stephen Ramsey', 'Erica Wood']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = ''
__email__ = ''
__status__ = 'Prototype'

import json

if __name__ == '__main__':
combos = dict()
with open('tui_combo_mappings.tsv') as combo_file:
line_count = 0
for line in combo_file:
line_count += 1
if line_count == 1:
continue
line = line.split('\t')
mapping = line[2]
tuis = list()
item_count = 0
for item in line:
if item_count > 2 and item_count % 2 == 1 and len(item) > 0:
tuis.append(item)
item_count += 1
tuis = str(tuple(tuis))
if len(mapping) > 0:
combos[tuis] = mapping
print(json.dumps(combos, indent=4, sort_keys=True))

0 comments on commit d4c7e49

Please sign in to comment.