Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # create STW-terms based on SWA thesaurus terms
- # 1x1 geographical terms
- infile = 'data_in/690FC_geo.csv'
- outfile = 'data_out/650_gndgeo.seq'
- konkordanz = dict()
- swa_topic = ''
- with open('konkordanzen/konk_geo_1x1.csv', newline='') as f1:
- for line in f1:
- splitted = line.split(';')
- if len(splitted) == 3:
- swa_topic1 = splitted[0]
- if swa_topic1 is not swa_topic:
- swa_topic = swa_topic1
- konkordanz[swa_topic] = (splitted[2].rstrip(), splitted[1])
- with open (infile, newline='') as f2:
- with open(outfile, 'w') as f3:
- for line in f2:
- splitted = line.split(';')
- if splitted[1].rstrip() in konkordanz:
- gndgeo = konkordanz[splitted[1].rstrip()]
- uri = gndgeo[1].rpartition('/')[2]
- f3.write('{} {}{}{}{}{}{}{}\n'.format(splitted[0], '651 7 L ', '$$a', gndgeo[0], '$$1', '(DE-588)', uri, '$$2gnd'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement