Moved files from nova_slovnica and data_admin repositories
This commit is contained in:
		
							parent
							
								
									5027a8388d
								
							
						
					
					
						commit
						d741a365ab
					
				| @ -1 +1,3 @@ | |||||||
| include conversion_utils/resources/jos_specifications.pickle | include conversion_utils/resources/jos_specifications.pickle | ||||||
|  | include conversion_utils/resources/dict.xml | ||||||
|  | include conversion_utils/resources/structure_conversions.csv | ||||||
|  | |||||||
							
								
								
									
										291
									
								
								conversion_utils/conllu_to_tei.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										291
									
								
								conversion_utils/conllu_to_tei.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,291 @@ | |||||||
|  | import argparse | ||||||
|  | import re | ||||||
|  | import sys | ||||||
|  | 
 | ||||||
|  | from lxml import etree | ||||||
|  | 
 | ||||||
|  | class Sentence: | ||||||
|  |     def __init__(self, _id, no_ud=False): | ||||||
|  |         self._id = _id | ||||||
|  |         self.items = [] | ||||||
|  |         self.links = [] | ||||||
|  |         self.no_ud = no_ud | ||||||
|  | 
 | ||||||
|  |     def add_item(self, token, lemma, upos, upos_other, xpos, misc): | ||||||
|  |         self.items.append([token, lemma, upos, upos_other, xpos, misc == "SpaceAfter=No"]) | ||||||
|  | 
 | ||||||
|  |     def add_link(self, link_ref, link_type): | ||||||
|  |         self.links.append([link_ref, link_type]) | ||||||
|  | 
 | ||||||
|  |     def as_xml(self, id_prefix=None): | ||||||
|  |         if id_prefix: | ||||||
|  |             xml_id = id_prefix + '.' + self._id | ||||||
|  |         else: | ||||||
|  |             xml_id = self._id | ||||||
|  |         base = etree.Element('s') | ||||||
|  |         set_xml_attr(base, 'id', xml_id) | ||||||
|  |         id_counter = 1 | ||||||
|  | 
 | ||||||
|  |         for item in self.items: | ||||||
|  |             token, lemma, upos, upos_other, xpos, no_space_after = item | ||||||
|  | 
 | ||||||
|  |             if xpos in {'U', 'Z'}: # hmm, safe only as long as U is unused in English tagset and Z in Slovenian one | ||||||
|  |                 to_add = etree.Element('pc') | ||||||
|  |             else: | ||||||
|  |                 to_add = etree.Element('w') | ||||||
|  |                 to_add.set('lemma', lemma) | ||||||
|  | 
 | ||||||
|  |             to_add.set('ana', 'mte:' + xpos) | ||||||
|  |             if not self.no_ud: | ||||||
|  |                 if upos_other != '_': | ||||||
|  |                     to_add.set('msd', f'UposTag={upos}|{upos_other}') | ||||||
|  |                 else: | ||||||
|  |                     to_add.set('msd', f'UposTag={upos}') | ||||||
|  | 
 | ||||||
|  |             set_xml_attr(to_add, 'id', "{}.{}".format(xml_id, id_counter)) | ||||||
|  |             to_add.text = token | ||||||
|  | 
 | ||||||
|  |             id_counter += 1 | ||||||
|  | 
 | ||||||
|  |             if no_space_after: | ||||||
|  |                 to_add.set('join', 'right') | ||||||
|  | 
 | ||||||
|  |             base.append(to_add) | ||||||
|  | 
 | ||||||
|  |         link_grp = etree.Element('linkGrp') | ||||||
|  |         link_grp.set('corresp', '#'+xml_id) | ||||||
|  |         link_grp.set('targFunc', 'head argument') | ||||||
|  |         link_grp.set('type', 'JOS-SYN') | ||||||
|  |         for link_id, item in enumerate(self.links): | ||||||
|  |             link_ref, link_type = item | ||||||
|  |             link = etree.Element('link') | ||||||
|  |             link.set('ana', 'jos-syn:' + link_type) | ||||||
|  |             if link_ref == u'0': | ||||||
|  |                 link.set('target', '#' + xml_id + ' #' + xml_id + '.' + str(link_id + 1)) | ||||||
|  |             else: | ||||||
|  |                 link.set('target', '#' + xml_id + '.' + link_ref + ' #' + xml_id + '.' + str(link_id + 1)) | ||||||
|  |             link_grp.append(link) | ||||||
|  |         base.append(link_grp) | ||||||
|  |         return base | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class Paragraph: | ||||||
|  |     def __init__(self, _id): | ||||||
|  |         self._id = _id | ||||||
|  |         self.sentences = [] | ||||||
|  | 
 | ||||||
|  |     def add_sentence(self, sentence): | ||||||
|  |         self.sentences.append(sentence) | ||||||
|  | 
 | ||||||
|  |     def as_xml(self, id_prefix=None): | ||||||
|  |         if id_prefix: | ||||||
|  |             xml_id = id_prefix + '.' + self._id | ||||||
|  |         else: | ||||||
|  |             xml_id = self._id | ||||||
|  | 
 | ||||||
|  |         p = etree.Element('p') | ||||||
|  |         set_xml_attr(p, 'id', xml_id) | ||||||
|  | 
 | ||||||
|  |         for sent in self.sentences: | ||||||
|  |             p.append(sent.as_xml(id_prefix=id_prefix)) | ||||||
|  |         return p | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class TeiDocument: | ||||||
|  |     def __init__(self, _id, paragraphs=list()): | ||||||
|  |         self._id = _id | ||||||
|  |         self.paragraphs = paragraphs | ||||||
|  | 
 | ||||||
|  |     def as_xml(self): | ||||||
|  |         root = etree.Element('TEI') | ||||||
|  |         root.set('xmlns', 'http://www.tei-c.org/ns/1.0') | ||||||
|  |         set_xml_attr(root, 'lang', 'sl') | ||||||
|  | 
 | ||||||
|  |         xml_id = self._id | ||||||
|  |         if xml_id is not None: | ||||||
|  |             set_xml_attr(root, 'id', xml_id) | ||||||
|  |          | ||||||
|  |         tei_header = etree.SubElement(root, 'teiHeader') | ||||||
|  | 
 | ||||||
|  |         text = etree.SubElement(root, 'text') | ||||||
|  |         body = etree.SubElement(text, 'body') | ||||||
|  |         for para in self.paragraphs: | ||||||
|  |             body.append(para.as_xml(id_prefix=xml_id)) | ||||||
|  | 
 | ||||||
|  |         encoding_desc = etree.SubElement(tei_header, 'encodingDesc') | ||||||
|  |         tags_decl = etree.SubElement(encoding_desc, 'tagsDecl') | ||||||
|  |         namespace = etree.SubElement(tags_decl, 'namespace') | ||||||
|  |         namespace.set('name', 'http://www.tei-c.org/ns/1.0') | ||||||
|  |         for tag in ['p', 's', 'pc', 'w']: | ||||||
|  |             count = int(text.xpath('count(.//{})'.format(tag))) | ||||||
|  |             tag_usage = etree.SubElement(namespace, 'tagUsage') | ||||||
|  |             tag_usage.set('gi', tag) | ||||||
|  |             tag_usage.set('occurs', str(count)) | ||||||
|  |         return root | ||||||
|  | 
 | ||||||
|  |     def add_paragraph(self, paragraph): | ||||||
|  |         self.paragraphs.append(paragraph) | ||||||
|  |          | ||||||
|  | 
 | ||||||
|  | def build_tei_etrees(documents): | ||||||
|  |     elements = [] | ||||||
|  |     for document in documents: | ||||||
|  |         elements.append(document.as_xml()) | ||||||
|  |     return elements | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def set_xml_attr(node, attribute, value): | ||||||
|  |     node.attrib['{http://www.w3.org/XML/1998/namespace}' + attribute] = value | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def parse_metaline(line): | ||||||
|  |     tokens = line.split('=', 1) | ||||||
|  |     key = tokens[0].replace('#', '').strip() | ||||||
|  |     if len(tokens) > 1 and not tokens[1].isspace(): | ||||||
|  |         val = tokens[1].strip() | ||||||
|  |     else: | ||||||
|  |         val = None | ||||||
|  |     return (key, val) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def is_metaline(line): | ||||||
|  |     if re.match('# .+ =.*', line): | ||||||
|  |         return True | ||||||
|  |     return False | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def construct_tei_documents(conllu_lines): | ||||||
|  |     documents = [] | ||||||
|  | 
 | ||||||
|  |     doc_id = None | ||||||
|  |     document_paragraphs  = [] | ||||||
|  | 
 | ||||||
|  |     para_id = None | ||||||
|  |     para_buffer = [] | ||||||
|  | 
 | ||||||
|  |     for line in conllu_lines: | ||||||
|  |         if is_metaline(line): | ||||||
|  |             key, val = parse_metaline(line) | ||||||
|  |             if key == 'newdoc id': | ||||||
|  |                 if len(para_buffer) > 0: | ||||||
|  |                     document_paragraphs.append(construct_paragraph(para_id, para_buffer)) | ||||||
|  |                 if len(document_paragraphs) > 0: | ||||||
|  |                     documents.append( | ||||||
|  |                         TeiDocument(doc_id, document_paragraphs)) | ||||||
|  |                     document_paragraphs = [] | ||||||
|  |                 doc_id = val | ||||||
|  |             elif key == 'newpar id': | ||||||
|  |                 if len(para_buffer) > 0: | ||||||
|  |                     document_paragraphs.append(construct_paragraph(para_id, para_buffer)) | ||||||
|  |                     para_buffer = [] | ||||||
|  |                 para_id = val | ||||||
|  |             elif key == 'sent_id': | ||||||
|  |                 para_buffer.append(line) | ||||||
|  |         else: | ||||||
|  |             if not line.isspace(): | ||||||
|  |                 para_buffer.append(line) | ||||||
|  | 
 | ||||||
|  |     if len(para_buffer) > 0: | ||||||
|  |         document_paragraphs.append(construct_paragraph(para_id, para_buffer)) | ||||||
|  | 
 | ||||||
|  |     if len(document_paragraphs) > 0: | ||||||
|  |         documents.append( | ||||||
|  |             TeiDocument(doc_id, document_paragraphs)) | ||||||
|  | 
 | ||||||
|  |     return documents | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def construct_paragraph(para_id, conllu_lines): | ||||||
|  |     para = Paragraph(para_id) | ||||||
|  | 
 | ||||||
|  |     sent_id = None | ||||||
|  |     sent_buffer = [] | ||||||
|  | 
 | ||||||
|  |     for line in conllu_lines: | ||||||
|  |         if is_metaline(line): | ||||||
|  |             key, val = parse_metaline(line) | ||||||
|  |             if key == 'sent_id': | ||||||
|  |                 if len(sent_buffer) > 0: | ||||||
|  |                     para.add_sentence(construct_sentence(sent_id, sent_buffer)) | ||||||
|  |                     sent_buffer = [] | ||||||
|  |                 sent_id = val | ||||||
|  |         elif not line.isspace(): | ||||||
|  |            sent_buffer.append(line)  | ||||||
|  | 
 | ||||||
|  |     if len(sent_buffer) > 0: | ||||||
|  |         para.add_sentence(construct_sentence(sent_id, sent_buffer)) | ||||||
|  | 
 | ||||||
|  |     return para | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def construct_sentence(sent_id, lines): | ||||||
|  |     sentence = Sentence(sent_id) | ||||||
|  |     for line in lines: | ||||||
|  |         if line.startswith('#') or line.isspace(): | ||||||
|  |             continue | ||||||
|  |         line = line.replace('\n', '') | ||||||
|  |         tokens = line.split('\t') | ||||||
|  |         word_id = tokens[0] | ||||||
|  |         token = tokens[1] | ||||||
|  |         lemma = tokens[2] | ||||||
|  |         upos = tokens[3] | ||||||
|  |         xpos = tokens[4] | ||||||
|  |         upos_other = tokens[5] | ||||||
|  |         depparse_link = tokens[6] | ||||||
|  |         depparse_link_name = tokens[7] | ||||||
|  |         misc = tokens[9] | ||||||
|  | 
 | ||||||
|  |         sentence.add_item( | ||||||
|  |                 token, | ||||||
|  |                 lemma, | ||||||
|  |                 upos, | ||||||
|  |                 upos_other, | ||||||
|  |                 xpos, | ||||||
|  |                 misc) | ||||||
|  | 
 | ||||||
|  |         sentence.add_link( | ||||||
|  |             depparse_link, | ||||||
|  |             depparse_link_name) | ||||||
|  |     return sentence | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def construct_tei_etrees(conllu_lines): | ||||||
|  |     documents = construct_tei_documents(conllu_lines) | ||||||
|  |     return build_tei_etrees(documents) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def convert_file(input_file_name, output_file_name): | ||||||
|  |     input_file = open(input_file_name, 'r') | ||||||
|  |     root = construct_tei_etrees(input_file)[0] | ||||||
|  |     tree = etree.ElementTree(root) | ||||||
|  |     tree.write(output_file_name, encoding='UTF-8', pretty_print=True) | ||||||
|  |     input_file.close() | ||||||
|  | 
 | ||||||
|  |     tree = etree.ElementTree(root) | ||||||
|  |     tree.write(output_file_name, pretty_print=True, encoding='utf-8') | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | if __name__ == '__main__': | ||||||
|  |     import argparse | ||||||
|  |     from glob import glob | ||||||
|  | 
 | ||||||
|  |     parser = argparse.ArgumentParser(description='Convert CoNNL-U to TEI.') | ||||||
|  |     parser.add_argument('files', nargs='+', help='CoNNL-U file') | ||||||
|  |     parser.add_argument('-o', '--out-file', dest='out', default=None, | ||||||
|  |                 help='Write output to file instead of stdout.') | ||||||
|  | 
 | ||||||
|  |     args = parser.parse_args() | ||||||
|  | 
 | ||||||
|  |     if args.out: | ||||||
|  |         f_out = open(args.out, 'w') | ||||||
|  |     else: | ||||||
|  |         f_out = sys.stdout | ||||||
|  | 
 | ||||||
|  |     for arg in args.files: | ||||||
|  |         filelist = glob(arg) | ||||||
|  |         for f in filelist: | ||||||
|  |             with open(f, 'r') as conllu_f: | ||||||
|  |                 tei_etrees = construct_tei_etrees(conllu_f) | ||||||
|  |             for tei_etree in tei_etrees: | ||||||
|  |                 f_out.write(etree.tostring(tei_etree, pretty_print=True, encoding='utf-8').decode()) | ||||||
|  |                 f_out.write('') | ||||||
							
								
								
									
										14
									
								
								conversion_utils/resources/dict.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								conversion_utils/resources/dict.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | |||||||
|  | <dict> | ||||||
|  |   <syns> | ||||||
|  |     <syn sl="modra" en="Root"/> | ||||||
|  |     <syn sl="del" en="PPart"/> | ||||||
|  |     <syn sl="dol" en="Atr"/> | ||||||
|  |     <syn sl="ena" en="Sb"/> | ||||||
|  |     <syn sl="dve" en="Obj"/> | ||||||
|  |     <syn sl="tri" en="AdvM"/> | ||||||
|  |     <syn sl="štiri" en="AdvO"/> | ||||||
|  |     <syn sl="prir" en="Coord"/> | ||||||
|  |     <syn sl="vez" en="Conj"/> | ||||||
|  |     <syn sl="skup" en="MWU"/> | ||||||
|  |   </syns> | ||||||
|  | </dict> | ||||||
							
								
								
									
										193
									
								
								conversion_utils/resources/structure_conversions.csv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								conversion_utils/resources/structure_conversions.csv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,193 @@ | |||||||
|  | gramrel|struktura|Name_ID|DSB|Simon|Simon-1|NSSS|Pov-REFL|Pov-NEG|Zgled|LBS|Opomba-1|Opomba-2|Opomba-3|Flip | ||||||
|  | S_G-inf|<struktura>gbz Inf-GBZ</struktura>|gg-ggn|12|50||12|||uspeti VIDETI|LBS-071|brez povratnih||| | ||||||
|  | S_nedoločnik|<struktura>GBZ Inf-gbz</struktura>|gg-ggn|12|50||12|||USPETI videti|LBS-071|brez povratnih||| | ||||||
|  | S_%s_g2|<struktura>GBZ %s sbz2</struktura>|gg-d-s2|13|34||13|||ODGOVORITI brez razmisleka|LBS-044|brez povratnega||| | ||||||
|  | S_%s_x_g2|<struktura>gbz %s SBZ2</struktura>|gg-d-s2|13|34||13|||skočiti s STOLA|LBS-044|brez povratnega||| | ||||||
|  | S_%s_g4|<struktura>GBZ %s sbz4</struktura>|gg-d-s4|14|36||14|||VNAŠATI v telo|LBS-046|brez povratnega||| | ||||||
|  | S_%s_x_g4|<struktura>gbz %s SBZ4</struktura>|gg-d-s4|14|36||14|||voziti v ŠOLO|LBS-046|brez povratnega||| | ||||||
|  | S_%s_x_g5|<struktura>gbz %s SBZ5</struktura>|gg-d-s5|15|37||15|||očistiti po UPORABI|LBS-047|brez povratnega||| | ||||||
|  | S_%s_g5|<struktura>GBZ %s sbz5</struktura>|gg-d-s5|15|37||15|||UŽIVATI v vožnji|LBS-047|brez povratnega||| | ||||||
|  | S_%s_x_g6|<struktura>gbz %s SBZ6</struktura>|gg-d-s6|16|38||16|||hoditi z BERGLAMI|LBS-048|brez povratnega|glej zgoraj opombo v vrstici 17, isti problem, drugi prvi del|| | ||||||
|  | S_%s_g6|<struktura>GBZ %s sbz6</struktura>|gg-d-s6|16|38||16|||VZGAJATI z ljubeznijo|LBS-048|brez povratnega||| | ||||||
|  | S_%s_g3|<struktura>GBZ %s sbz3</struktura>|gg-d-s3|17|35||17|||RAVNATI proti vesti|LBS-045|brez povratnega||| | ||||||
|  | S_%s_x_g3|<struktura>gbz %s SBZ3</struktura>|gg-d-s3|17|35||17|||steči proti VRATOM|LBS-045|brez povratnega||| | ||||||
|  | S_kakšen-g?|<struktura>gbz PBZ1</struktura>|gg-p1|18|16||18|||pozirati GOL|LBS-019|brez povratnega||| | ||||||
|  | S_kakšen-p?|<struktura>GBZ pbz1</struktura>|gg-p1|18|16||18|||TEČI bos|LBS-019|brez povratnega||| | ||||||
|  | S_je_za_g|<struktura>gbz RBZ</struktura>||20|||||||LBS-023|<!-- LBS23 excluded (S_kako-kdaj-za_g?/S_je_za_g) - replicates LBS22, positional adverbs, now handled by treebank -->|združiti s strukturo 43||43 | ||||||
|  | S_kako-kdaj-za_g?|<struktura>GBZ rbz</struktura>||20|||||||LBS-023|<!-- LBS23 excluded (S_kako-kdaj-za_g?/S_je_za_g) - replicates LBS22, positional adverbs, now handled by treebank -->|združiti s strukturo 43||43 | ||||||
|  | S_v_rodil|<struktura>GBZ sbz2</struktura>||21|6||||||LBS-006||nova struktura 108|| | ||||||
|  | S_koga-česa|<struktura>gbz SBZ2</struktura>||21|6||||||LBS-006||nova struktura 108|| | ||||||
|  | S_v_dajal|<struktura>GBZ sbz3</struktura>|gg-s3|22|7||22|||SPREGOVORITI ljudstvu|LBS-007|brez povratnega||| | ||||||
|  | S_komu-čemu|<struktura>gbz SBZ3</struktura>|gg-s3|22|7||22|||zaupati VODSTVU|LBS-007|brez povratnega||| | ||||||
|  | S_koga-kaj|<struktura>gbz SBZ4</struktura>|gg-s4|23|8||23|||pogrniti MIZO|LBS-008|brez povratnega||| | ||||||
|  | S_v_tožil|<struktura>GBZ sbz4</struktura>|gg-s4|23|8||23|||STISNITI sok|LBS-008|brez povratnega||| | ||||||
|  | S_zanikani|<struktura>Neg-gbz SBZ2</struktura>|l-gg-s2|24|11|2|24||23|ne prepuščati ZRAKA|LBS-011|||| | ||||||
|  | S_z_nikalnim|<struktura>Neg-GBZ sbz2</struktura>|l-gg-s2|24|11|2|24||23|ne STISNITI zavore |LBS-011|||| | ||||||
|  | S_G-neg-inf|<struktura>Neg-gbz Inf-GBZ</struktura>|l-gg-ggn|25|51||25||12|ne ZAČETI teči|LBS-072|brez povratnih|pojavlja se tudi Neg-gbz Inf GBZ (Neg z veliko)|| | ||||||
|  | S_%s_x_p2|<struktura>pbz0 %s SBZ2</struktura>|p0-d-s2|26|39||26|||izdelan iz BOMBAŽA|LBS-054|||| | ||||||
|  | S_%s_p2|<struktura>PBZ0 %s sbz2</struktura>|p0-d-s2|26|39||26|||VELJAVEN do decembra|LBS-054|||| | ||||||
|  | S_%s_x_p4|<struktura>pbz0 %s SBZ4</struktura>|p0-d-s4|27|41||27|||alergičen na SONCE|LBS-056|||| | ||||||
|  | S_%s_p4|<struktura>PBZ0 %s sbz4</struktura>|p0-d-s4|27|41||27|||VAREN za uživanje|LBS-056|||| | ||||||
|  | S_%s_x_p5|<struktura>pbz0 %s SBZ5</struktura>|p0-d-s5|28|42||28|||prepričan o USPEHU|LBS-057|||| | ||||||
|  | S_%s_p5|<struktura>PBZ0 %s sbz5</struktura>|p0-d-s5|28|42||28|||UTRUJEN po tekmi|LBS-057|||| | ||||||
|  | S_%s_p6|<struktura>PBZ0 %s sbz6</struktura>|p0-d-s6|29|43||29|||IZVOLJEN z večino|LBS-058|||| | ||||||
|  | S_%s_x_p6|<struktura>pbz0 %s SBZ6</struktura>|p0-d-s6|29|43||29|||razočaran nad ODLOČITVIJO|LBS-058|glej zgoraj opombo v vrstici 17, isti problem, drugi prvi del||| | ||||||
|  | S_priredje|<struktura>PBZ0 in/ali pbz0</struktura>|p0-vp-p0|30|64||30|||DOBER in/ali SLAB|LBS-099|||| | ||||||
|  | S_%s_x_p3|<struktura>pbz0 %s SBZ3</struktura>|p0-d-s3|31|40||31|||nagnjen k ZLORABI|LBS-055|||| | ||||||
|  | S_%s_p3|<struktura>PBZ0 %s sbz3</struktura>|p0-d-s3|31|40||31|||NAMENJEN proti domu|LBS-055|||| | ||||||
|  | S_primera|<struktura>PBZ0 kot sbz0</struktura>|p0-vd-s0|32|21||32|||LAČEN kot volk / utrujen kot PES|LBS-025|||| | ||||||
|  | S_je_za_p|<struktura>pbz0 RBZ</struktura>||33|||||||LBS-028|<!-- LBS28 excluded (S_kako-kdaj-za_p?/S_je_za_p) - replicates LBS27, positional adverbs, now handled by treebank -->|združiti s strukturo 46||46 | ||||||
|  | S_kako-kdaj-za_p?|<struktura>PBZ0 rbz</struktura>||33|||||||LBS-028|<!-- LBS28 excluded (S_kako-kdaj-za_p?/S_je_za_p) - replicates LBS27, positional adverbs, now handled by treebank -->|združiti s strukturo 46||46 | ||||||
|  | S_kakšen?|<struktura>pbz0 SBZ0</struktura>|p0-s0|34|1||34|||bela ZASTAVA|LBS-001|||| | ||||||
|  | S_kdo-kaj?|<struktura>PBZ0 sbz0</struktura>|p0-s0|34|1||34|||RDEČA jagoda|LBS-001|||| | ||||||
|  | S_p-koga-česa|<struktura>pbz0 SBZ2</struktura>|p0-s2|35|2||35|||[biti] obtožen UTAJE|LBS-002|||| | ||||||
|  | S_v_rodil-p|<struktura>PBZ0 sbz2</struktura>|p0-s2|35|2||35|||[biti] VESEL uspeha|LBS-002|||| | ||||||
|  | S_v_dajal-p|<struktura>PBZ0 sbz3</struktura>|p0-s3|36|3||36|||[biti] NAMENJEN vzgoji|LBS-003|||| | ||||||
|  | S_p-komu-čemu|<struktura>pbz0 SBZ3</struktura>|p0-s3|36|3||36|||[biti] zvest GOSPODARJU|LBS-003|||| | ||||||
|  | S_oba-v-rod|<struktura>PBZ2 sbz2</struktura>|p2-s2|37|4||37|||[biti] DOBRE volje|LBS-004|||| | ||||||
|  | S_oba-v-rod|<struktura>pbz2 SBZ2</struktura>|p2-s2|37|4||37|||[biti] dobrega SRCA|LBS-004|||| | ||||||
|  | S_%s_r2|<struktura>RBZ %s sbz2</struktura>|r-d-s2|38|44||38|||DANES do polnoči|LBS-064|||| | ||||||
|  | S_%s_r3|<struktura>RBZ %s sbz3</struktura>|r-d-s3|39|45||39|||VČERAJ proti večeru|LBS-065|||| | ||||||
|  | S_%s_r5|<struktura>RBZ %s sbz5</struktura>|r-d-s5|40|47||40|||VIDNO v zadregi|LBS-067|||| | ||||||
|  | S_%s_r4|<struktura>RBZ %s sbz4</struktura>|r-d-s4|41|46||41|||MALO za šalo|LBS-066|||| | ||||||
|  | S_%s_r6|<struktura>RBZ %s sbz6</struktura>|r-d-s6|42|48||42|||JUTRI pred odhodom|LBS-068|||vse so strukture| | ||||||
|  | S_kako-kdaj_g?|<struktura>rbz GBZ</struktura>|r-gg|43|19||43|||čvrsto STISNITI|LBS-022|brez povratnega||| | ||||||
|  | S_je_pred_g|<struktura>RBZ gbz</struktura>|r-gg|43|19||43|||DEBELO gledati|LBS-022|brez povratnega||| | ||||||
|  | S_priredje|<struktura>RBZ in/ali rbz</struktura>|r-vp-r|44|67||44|||VČERAJ in/ali DANES|LBS-099||samo prvega zapišemo z velikimi črkami|| | ||||||
|  | S_primera|<struktura>RBZ kot sbz0</struktura>|r-vd-s0|45|22||45|||TIHO kot miš / mrzlo kot VRAG|LBS-025|||| | ||||||
|  | S_kako-kdaj_p?|<struktura>rbz PBZ0</struktura>|r-p0|46|24||46|||dovolj ZREL|LBS-027||sprememba v pridevniško lemo|| | ||||||
|  | S_je_pred_p|<struktura>RBZ pbz0</struktura>|r-p0|46|24||46|||RESNIČNO izjemen|LBS-027||sprememba v pridevniško lemo|| | ||||||
|  | S_količinski|<struktura>rbz SBZ2</struktura>|r-s2|47|28||47|||malo MOŽNOSTI|LBS-033|||| | ||||||
|  | S_količina_ob-s|<struktura>RBZ sbz2</struktura>|r-s2|47|28||47|||VELIKO ljudi|LBS-033|||| | ||||||
|  | S_%s_x_s2|<struktura>sbz0 %s SBZ2</struktura>|s0-d-s2|48|29||48|||dan brez AVTOMOBILA|LBS-034|||| | ||||||
|  | S_%s_s2|<struktura>SBZ0 %s sbz2</struktura>|s0-d-s2|48|29||48|||LISTINA iz spisa |LBS-034|||| | ||||||
|  | S_%s_s3|<struktura>SBZ0 %s sbz3</struktura>|s0-d-s3|49|30||49|||DOPOLNILO k zahvali |LBS-035|||| | ||||||
|  | S_%s_x_s3|<struktura>sbz0 %s SBZ3</struktura>|s0-d-s3|49|30||49|||poziv k ODSTOPU|LBS-035|||| | ||||||
|  | S_%s_s6|<struktura>SBZ0 %s sbz6</struktura>|s0-d-s6|50|33||50|||IZBOR med kandidati|LBS-038|"pri predlogu z se pojavljajo tudi zapisi ""SBZ0 s/z sbz6"" in ""SBZ0 z/s sbz6"", ker je ""s"" variantna oblika od ""z"" (lemma od obeh je ""z"")"|povsem enako kot za s/z velja za h/k (lemma od obeh je k)|| | ||||||
|  | S_%s_x_s6|<struktura>sbz0 %s SBZ6</struktura>|s0-d-s6|50|33||50|||odnos s PARTNERJEM|LBS-038|glej zgoraj opombo v vrstici 17, isti problem, drugi prvi del||| | ||||||
|  | S_%s_s4|<struktura>SBZ0 %s sbz4</struktura>|s0-d-s4|51|31||51|||OBESEK za ključ|LBS-036|||| | ||||||
|  | S_%s_x_s4|<struktura>sbz0 %s SBZ4</struktura>|s0-d-s4|51|31||51|||predavanje na TEMO|LBS-036|||| | ||||||
|  | S_%s_s5|<struktura>SBZ0 %s sbz5</struktura>|s0-d-s5|52|32||52|||OTOK ob obali|LBS-037|||| | ||||||
|  | S_%s_x_s5|<struktura>sbz0 %s SBZ5</struktura>|s0-d-s5|52|32||52|||pesmica o SREČI|LBS-037|||| | ||||||
|  | S_v_rodil-s|<struktura>SBZ0 sbz2</struktura>|s0-s2|53|13||53|||PRANJE denarja|LBS-016|||| | ||||||
|  | S_s-koga-česa|<struktura>sbz0 SBZ2</struktura>|s0-s2|53|13||53|||utaja DAVKOV|LBS-016|||| | ||||||
|  | S_v_dajal-s|<struktura>SBZ0 sbz3</struktura>|s0-s3|54|14||54|||PISMO predsedniku|LBS-017|||| | ||||||
|  | S_s-komu-čemu|<struktura>sbz0 SBZ3</struktura>|s0-s3|54|14||54|||zahvala SPONZORJU|LBS-017|||| | ||||||
|  | S_prislov_prislov|<struktura>rbz RBZ</struktura>|r-r|55|25||55|||zares IZJEMNO / ENAKO besno|LBS-030|||| | ||||||
|  | S_s_prislovom|<struktura>s prislovom</struktura>||56|||||||LBS-012|<!-- LBS12 excluded (S_s_prislovom/S_s_prislovom) - not a collocation -->|brisati tudi podatke|| | ||||||
|  | S_s_prislovom|<struktura>s prislovom</struktura>||56|||||||LBS-012|<!-- LBS12 excluded (S_s_prislovom/S_s_prislovom) - not a collocation -->|brisati tudi podatke|| | ||||||
|  | S_Vez_P1|<struktura>sbz1 Vez-gbz PBZ1</struktura>|s1-gp-p1|57|5||57|||hruška je ZRELA|LBS-005|||| | ||||||
|  | S_S1_Vez_P|<struktura>SBZ1 Vez-gbz pbz1</struktura>|s1-gp-p1|57|5||57|||REZULTATI so dobri|LBS-005|||| | ||||||
|  | ||gg-zp-s3||7||68|22||izneveriti se tradiciji|LBS-007|samo povratni (nova)||| | ||||||
|  | ||gg-zp-s4||8||69|23||ogledati si posnetek|LBS-008|samo povratni (nova)||| | ||||||
|  | S_osebek_od|<struktura>SBZ1 gbz</struktura>|s1-gg||9||70|||PANIKA zavlada|LBS-009|brez povratnega||| | ||||||
|  | S_osebek_je|<struktura>sbz1 GBZ</struktura>|s1-gg||9||70|||večina RAZUME |LBS-009|brez povratnega||| | ||||||
|  | ||s1-zp-gg||9||71|70||človek se USTRAŠI|LBS-009|samo povratni (nova)||| | ||||||
|  | S_n-osebek_je|<struktura>sbz1 Neg-GBZ</struktura>|s1-l-gg||10|1|72||70|voda ne TEČE|LBS-010|brez povratnega||| | ||||||
|  | S_n-osebek_od|<struktura>SBZ1 neg-gbz</struktura>|s1-l-gg||10|1|72||70|ČLOVEK ne vidi |LBS-010|brez povratnega||| | ||||||
|  | ||s1-zp-l-gg||10|1|73|72|70|vernik se ne BRIJE |LBS-010|samo povratni (nova)||| | ||||||
|  | S_zanikani|<struktura>Neg-gbz SBZ2</struktura>|ggz-s2||11|1|74||23|ne hoteti ODGOVORA|LBS-011|brez povratnega||| | ||||||
|  | S_z_nikalnim|<struktura>Neg-GBZ sbz2</struktura>|ggz-s2||11|1|74||23|ne IMETI znanja|LBS-011|brez povratnega||| | ||||||
|  | ||l-gg-zp-s2||11|1|75|24|23|ne ZVITI si noge|LBS-011|samo povratni (nova)||| | ||||||
|  | S_sam-im_sam|<struktura>sbz0 SBZ0</struktura>|s0-s0||12||76|||angina PECTORIS|LBS-014|||| | ||||||
|  | S_im_sam-sam|<struktura>SBZ0 sbz0</struktura>|s0-s0||12||76|||ČLOVEK pajek|LBS-014|||| | ||||||
|  | S_Vez_S|<struktura>SBZ1 Vez-gbz sbz1</struktura>|s0-gp-s1||15||77|||STRIC je partizan|LBS-018|||| | ||||||
|  | ||gg-zp-p1||16||78|18||zdeti se premagan|LBS-019|samo povratni (nova)||| | ||||||
|  | S_kakšnega-p|<struktura>Vez-gbz PBZ4</struktura>|gg-p4|19|17||19|||pustiti SAMEGA|LBS-020|brez povratnega|to je v resnici številka 19 v DSB|SPREMLJATI REZULTAT!| | ||||||
|  | S_kakšnega-g?|<struktura>Vez-GBZ pbz4</struktura>|gg-p4|19|17||19|||VIDETI nasmejanega|LBS-020|brez povratnega|to je v resnici številka 19 v DSB|SPREMLJATI REZULTAT!| | ||||||
|  | ||gg-zp-p4||17||80|19||počutiti se osamljenega|LBS-020|samo povratni (nova)||| | ||||||
|  | ||r-zp-gg||19||81|43||močno se prestrašiti|LBS-022|samo povratni (nova)||| | ||||||
|  | S_primera|<struktura>GBZ kot sbz0</struktura>|gg-vd-s0||20||82|||BRUHATI kot vidra|LBS-025|brez povratnega||| | ||||||
|  | ||gg-zp-vd-s0||20||83|82||pojavljati se kot mora|LBS-025|samo povratni (nova)||| | ||||||
|  | S_primera|<struktura>SBZ0 kot sbz0</struktura>|s0-vd-s0||23||84|||ZDRAVJE kot vrednota / vrednost kot OSNOVA|LBS-025||NE IZPISUJE 'KOT'!|| | ||||||
|  | S_kako-kdaj_r|<struktura>RBZ Vez-gbz pbz1</struktura>|r-p1||26||85|||[biti] objavljen včeraj|LBS-031|||| | ||||||
|  | ||gg-zp-d-s2||34||86|13||pripeljati se do banke|LBS-044|samo povratni (nova)||| | ||||||
|  | ||gg-zp-d-s3||35||87|17||odločiti se kljub nasprotovanju|LBS-045|samo povratni (nova)||| | ||||||
|  | ||gg-zp-d-s4||36||88|14||voziti se v službo|LBS-047|samo povratni (nova)||| | ||||||
|  | ||gg-zp-d-s5||37||89|15||kopati se v morju|LBS-047|samo povratni (nova)||| | ||||||
|  | ||gg-zp-d-s6||38||90|16||pripeljati se z mopedom|LBS-048|samo povratni (nova)||| | ||||||
|  | S_%s_r|<struktura>sbz0 %s RBZ</struktura>|s0-d-r||49||91|||prijatelj za VEDNO|LBS-069|||popravljeno| | ||||||
|  | ||gg-zp-ggn||||92|12||prizadevati si poiskati|LBS-071|samo povratni prvi glagol (nova)||| | ||||||
|  | ||gg-ggn-zp||||93|12||utegniti zaplesti se|LBS-071|samo povratni drugi glagol (nova)||| | ||||||
|  | ||gg-zp-ggn-zp||||94|92/93||odločiti se prodati se|LBS-071|samo povratni oba glagola (nova)||| | ||||||
|  | ||l-gg-zp-ggn||51||95|25|92|ne dati se predvideti|LBS-072|samo povratni prvi glagol (nova)||| | ||||||
|  | ||l-gg-ggn-zp||51||96|25|93|ne uspeti udeležiti se|LBS-072|samo povratni drugi glagol (nova)||| | ||||||
|  | ||l-gg-zp-ggn-zp||51||97|25|94|ne bati se pokazati se|LBS-072|samo povratni oba glagola (nova)||| | ||||||
|  | S_R-inf|<struktura>rbz Vez-gbz Inf-GBZ</struktura>|r-ggn||52||98|||[biti] bolje PRESEKATI|LBS-073|brez povratnega||| | ||||||
|  | ||r-ggn-zp||52||99|98||[biti] bolje smejati se|LBS-073|samo povratni (nova)||| | ||||||
|  | S_P-inf|<struktura>pbz1 Vez-gbz Inf-GBZ</struktura>|p1-ggn||54||100|||[biti] prisiljen ZAPRETI|LBS-075|brez povratnega||| | ||||||
|  | ||p1-ggn-zp||54||101|100||[biti] pripravljen zadolžiti se|LBS-075|samo povratni (nova)||| | ||||||
|  | S_S-inf|<struktura>sbz1 Vez-gbz Inf-GBZ</struktura>|s1-ggn||56||102|||pravica POČETI |LBS-077|brez povratnega||| | ||||||
|  | ||s1-ggn-zp||56||103|||pravica odločati se|LBS-077|samo povratni (nova)||| | ||||||
|  | S_namenilnik|<struktura>gbz Nam-GBZ</struktura>|gg-ggm||58||104|||iti PLAVAT|LBS-079|brez povratnega||| | ||||||
|  | ||gg-ggm-zp||58||105|||iti ogledat si|LBS-079|samo povratni (nova)||| | ||||||
|  | S_priredje|<struktura>priredje</struktura>|s0-vp-s0||65||106|||VINO in/ali PIVO|LBS-099||"to najdemo tudi kot ""SBZ0 in sbz0"", ""SBZ0 in/ali sbz0"""|| | ||||||
|  | S_priredje|<struktura>GBZ in/ali gbz</struktura>|gg-vp-gg||66||107|||GOVORITI in/ali ŠEPETATI|LBS-099||"ta struktura je lahko ""GBZ in gbz"", ""GBZ ali gbz"", ""GBZ in/ali gbz"", pa tudi ""GBZ in/ali GBZ"" (oba elementa zapisana z veliko)"|za pretvorbo damo samo prvega z velikimi črkami| | ||||||
|  | ||gg-zp-s2||6||108|||BATI se maščevanja|LBS-006|samo povratni (nova)|bivša struktura 21|| | ||||||
|  | ||gg-zp-s2||6||108|||želeti si ZDRAVJA|LBS-006|samo povratni (nova)|bivša struktura 22|| | ||||||
|  | S_n-osebek_je|<struktura>sbz1 Neg-GBZ</struktura>|s1-ggz||10|2||||država NIMA |LBS-010|odstranimo?||| | ||||||
|  | S_n-osebek_od|<struktura>SBZ1 neg-gbz</struktura>|s1-ggz||10|2||||ČLOVEK nima|LBS-010|odstranimo?||| | ||||||
|  | S_neg-kakšnega-g?|<struktura>Neg-GBZ pbz2</struktura>|||18|1/2||||ne RAZUMETI prebranega /  ne IMETI zaposlenih|LBS-021|odstranimo?||| | ||||||
|  | S_neg-kakšnega-p|<struktura>Neg-gbz PBZ2</struktura>|||18|1/2||||ne želeti SLABEGA / ne hoteti SLABEGA|LBS-021|odstranimo?||| | ||||||
|  | S_kdo-kaj_r|<struktura>sbz1 Vez-gbz RBZ</struktura>|||27|||||vzdušje je IZJEMNO|LBS-032|odstranimo|NESMISELNI REZULTATI - PRIDEVNIK, ponavlja NSSS id-57|| | ||||||
|  | S_R-neg-inf|<struktura>rbz Neg-Vez-gbz Inf-GBZ</struktura>|||53|1||||ne (biti) lahko ZAPUSTITI|LBS-074|odstranimo||| | ||||||
|  | S_P-neg-inf|<struktura>pbz1 Neg-Vez-gbz Inf-GBZ</struktura>|||55|1||||ne (biti) dolžen OBJAVITI|LBS-076|odstranimo||| | ||||||
|  | S_S-neg-inf|<struktura>sbz1 Neg-Vez-gbz Inf-GBZ</struktura>|||57|1||||ne (vzeti) časa POISKATI|LBS-078|odstranimo||| | ||||||
|  | S_biti_s2|<struktura>vez-gbz SBZ2</struktura>|||59|||||biti brez VOLJE|LBS-082|odstranimo|to pokriva id 34|| | ||||||
|  | S_biti_s3|<struktura>vez-gbz SBZ3</struktura>|||60|||||biti proti VOLJi|LBS-083|odstranimo|to pokriva id 35|| | ||||||
|  | S_biti_s4|<struktura>vez-gbz SBZ4</struktura>|||61|||||biti na VOLJO|LBS-084|odstranimo|to pokriva id 36|| | ||||||
|  | S_biti_s5|<struktura>vez-gbz SBZ5</struktura>|||62|||||biti po VOLJI|LBS-085|odstranimo|to pokriva id 37|| | ||||||
|  | S_biti_s6|<struktura>vez-gbz SBZ6</struktura>|||63|||||biti pod VPLIVOM|LBS-086|odstranimo|to pokriva id 38|| | ||||||
|  | |<struktura>PBZ0 gbz</struktura>|||||||||***|||| | ||||||
|  | S_vezni|<struktura>gbz SBZ1</struktura>|||||||||LBS-013|<!-- LBS-013 excluded (S_vezni) - not a collocation /gbz SBZ1/ -->||| | ||||||
|  | S_s-kdo-kaj|<struktura>sbz0 SBZ1</struktura>|||||||||LBS-015|<!-- LBS-015 excluded (S_v_imen-s/S_s-kdo-kaj) - replicates LBS14, too noisy -->||| | ||||||
|  | S_v_imen-s|<struktura>SBZ0 sbz1</struktura>|||||||||LBS-015|<!-- LBS-015 excluded (S_v_imen-s/S_s-kdo-kaj) - replicates LBS14, too noisy -->||| | ||||||
|  | S_veznik_enob|<struktura>SBZ0 Odv</struktura>|||||||||LBS-024|<!-- LBS-024 excluded (S_veznik_enob) - not a collocation -->||| | ||||||
|  | S_veznik_enob|<struktura>RBZ Odv</struktura>|||||||||LBS-024|<!-- LBS-024 excluded (S_veznik_enob) - not a collocation -->||| | ||||||
|  | S_veznik_enob|<struktura>PBZ0 Odv</struktura>|||||||||LBS-024|<!-- LBS-024 excluded (S_veznik_enob) - not a collocation -->||| | ||||||
|  | S_veznik_enob|<struktura>GBZ Odv</struktura>|||||||||LBS-024|<!-- LBS-024 excluded (S_veznik_enob) - not a collocation -->||| | ||||||
|  | S_simile|<struktura>primera</struktura>|||||||||LBS-025|"replicira drugo stran ""primera"""||| | ||||||
|  | S_predl-pred|<struktura>s predlogom</struktura>|||||||||LBS-026|<!-- LBS-026 excluded (S_predl-pred) - not a collocation -->||| | ||||||
|  | V_biti_videti|<vzorec>biti videti %s</vzorec>|||||||||LBS-029|<!-- LBS-029 excluded (V_biti_videti) - not a collocation -->|ta je pri pridevniku|| | ||||||
|  | V_biti_videti|<struktura>biti videti</struktura>|||||||||LBS-033|<!-- LBS-033 excluded (V_biti_videti) - not a collocation -->|bi moralo biti struktura|| | ||||||
|  | S_%(3.lempos)_x_s2||||||||||LBS-039|  <!-- LBS-039 excluded (S_%(3.lempos)_x_s2) - replicates LBS34 -->||| | ||||||
|  | S_%(3.lempos)_x_s3||||||||||LBS-040|  <!-- LBS-040 excluded (S_%(3.lempos)_x_s3) - replicates LBS35 -->||| | ||||||
|  | S_%(3.lempos)_x_s4||||||||||LBS-041|  <!-- LBS-041 excluded (S_%(3.lempos)_x_s4) - replicates LBS36 -->||| | ||||||
|  | S_%(3.lempos)_x_s5||||||||||LBS-042|  <!-- LBS-042 excluded (S_%(3.lempos)_x_s5) - replicates LBS37 -->||| | ||||||
|  | S_%(3.lempos)_x_s6||||||||||LBS-043|  <!-- LBS-043 excluded (S_%(3.lempos)_x_s6) - replicates LBS38 -->||| | ||||||
|  | S_%(3.lempos)_x_g2||||||||||LBS-049|  <!-- LBS-049 excluded (S_%(3.lempos)_x_g2) - replicates LBS44 -->||| | ||||||
|  | S_%(3.lempos)_x_g3||||||||||LBS-050|  <!-- LBS-050 excluded (S_%(3.lempos)_x_g3) - replicates LBS45 -->||| | ||||||
|  | S_%(3.lempos)_x_g4||||||||||LBS-051|  <!-- LBS-051 excluded (S_%(3.lempos)_x_g4) - replicates LBS46 -->||| | ||||||
|  | S_%(3.lempos)_x_g5||||||||||LBS-052|  <!-- LBS-052 excluded (S_%(3.lempos)_x_g5) - replicates LBS47 -->||| | ||||||
|  | S_%(3.lempos)_x_g6||||||||||LBS-053|  <!-- LBS-053 excluded (S_%(3.lempos)_x_g6) - replicates LBS48 -->||| | ||||||
|  | S_%(3.lempos)_x_p2||||||||||LBS-059|  <!-- LBS-059 excluded (S_%(3.lempos)_x_p2) - replicates LBS54 -->||| | ||||||
|  | S_%(3.lempos)_x_p3||||||||||LBS-060|  <!-- LBS-060 excluded (S_%(3.lempos)_x_p3) - replicates LBS55 -->||| | ||||||
|  | S_%(3.lempos)_x_p4||||||||||LBS-061|  <!-- LBS-061 excluded (S_%(3.lempos)_x_p4) - replicates LBS56 -->||| | ||||||
|  | S_%(3.lempos)_x_p5||||||||||LBS-062|  <!-- LBS-062 excluded (S_%(3.lempos)_x_p5) - replicates LBS57 -->||| | ||||||
|  | S_%(3.lempos)_x_p6||||||||||LBS-063|  <!-- LBS-063 excluded (S_%(3.lempos)_x_p6) - replicates LBS58 -->||| | ||||||
|  | S_nedoločnik|<struktura>SBZ0 Inf-gbz</struktura>|||||||||LBS-070|<!-- LBS-070 excluded (S_nedoločnik) - replicates LBS-071 -->||| | ||||||
|  | S_nedoločnik|<struktura>RBZ Inf-gbz</struktura>|||||||||LBS-070|<!-- LBS-070 excluded (S_nedoločnik) - replicates LBS71 -->||| | ||||||
|  | S_nedoločnik|<struktura>PBZ0 Inf-gbz</struktura>|||||||||LBS-070|<!-- LBS-070 excluded (S_nedoločnik) - replicates LBS71 -->||| | ||||||
|  | S_G_GInf_O4|<struktura>gbz Inf-gbz SBZ4</struktura>|||||||||LBS-080|<!-- LBS-080 excluded (S_G_GInf_O4) - CONSTRUCTION: combines two existing gramrels -->||| | ||||||
|  | S_Vez_Inf_S|<struktura>SBZ1 vez-gbz Inf-gbz</struktura>|||||||||LBS-081 |<!-- LBS-081 excluded (S_Vez_Inf_S) - CONSTRUCTION: not clear what it does -->||ok| | ||||||
|  | O_z_lastnim_imenom|<oznaka>pogosto z lastnim imenom</oznaka>|||||||||LBS-087|<!-- LBS-087 excluded (O_z_lastnim_imenom) - CONSTRUCTION+UNARY: indicates presence of proper names -->|manjka|ok| | ||||||
|  | O_s_števili|<oznaka>pogosto s števili</oznaka>|||||||||LBS-088|<!-- LBS-088 excluded (O_s_števili) - CONSTRUCTION+UNARY: indicates presence of numerals -->|"manjka (je mogooče ""pogosto s števili"")?"|| | ||||||
|  | V_S_V_O3_O4|<vzorec>kdo/kaj G komu kaj</vzorec>|||||||||LBS-089|<!-- LBS-089 excluded (V_S_V_O3_O4) - CONSTRUCTION: will be included as a valency pattern -->||| | ||||||
|  | V_S_V_O3_O2|<vzorec>kdo/kaj G komu koga/česa</vzorec>|||||||||LBS-090|<!-- LBS-090 excluded (V_S_V_O3_O2) - CONSTRUCTION: will be included as a valency pattern -->||| | ||||||
|  | V_S_V_O4_predl|<vzorec>kdo/kaj G koga/kaj + predlog</vzorec>|||||||||LBS-091|<!-- LBS-091 excluded (V_S_V_O4_predl) - CONSTRUCTION: will be included as a valency pattern -->||| | ||||||
|  | V_S_V_O3|<vzorec>kdo/kaj G komu</vzorec>|||||||||LBS-092|<!-- LBS-092 excluded (V_S_V_O3) - CONSTRUCTION: will be included as a valency pattern -->||| | ||||||
|  | V_gl_Cit|<struktura>cit GBZ</struktura>|||||||||LBS-093|<!-- LBS-093 excluded (V_gl_Cit) - CONSTRUCTION: indicates presence of citation -->|tu je bil prej vzorec, spremenjeno v struktura, ker je tako v bazi|| | ||||||
|  | O_povratni_se|<oznaka>povratni (se)</oznaka>|||||||||LBS-094|<!-- LBS-094 excluded (O_povratni_se) - CONSTRUCTION+UNARY: indicates presence of a reflexive pronoun -->||| | ||||||
|  | O_povratni_si|<oznaka>povratni (si)</oznaka>|||||||||LBS-095|<!-- LBS-095 excluded (O_povratni_si) - CONSTRUCTION+UNARY: indicates presence of a reflexive pronoun -->||| | ||||||
|  | O_nedoločnik_cs|<oznaka>pogosto v nedoločniku</oznaka>|||||||||LBS-096|<!-- LBS-096 excluded (O_nedoločnik_cs) - CONSTRUCTION+UNARY: indicates frequency of infinitive -->||| | ||||||
|  | O_tretja_oseba|<oznaka>pogosto v tretji osebi</oznaka>|||||||||LBS-097|<!-- LBS-097 excluded (O_tretja_oseba) - CONSTRUCTION+UNARY: indicates frequency of third person -->||| | ||||||
|  | V_lahko_G|<vzorec>mod-rbz GBZ</vzorec>|||||||||LBS-098|<!-- LBS-098 excluded (V_lahko_G) - CONSTRUCTION: indicates presence of the modal adverb 'lahko' -->|ta je pri glagolu|| | ||||||
|  | V_lahko_G|<struktura>mod-rbz GBZ</struktura>|||||||||LBS-098|<!-- LBS-098 excluded (V_lahko_G) - CONSTRUCTION: indicates presence of the modal adverb 'lahko' -->|tu je bil prej vzorec, spremenjeno v struktura, ker je tako v bazi|| | ||||||
|  | S_z_vezajem|<struktura>rbz1-RBZ0</struktura>|||||||||LBS-100|<!-- LBS-100 excluded (S_z_vezajem) - SYMMETRIC: coordinate structure with a hyphen -->||| | ||||||
|  | S_z_vezajem|<struktura>pbz1{-}PBZ0</struktura>|||||||||LBS-100|<!-- LBS-100 excluded (S_z_vezajem) - SYMMETRIC: coordinate structure with a hyphen -->|možna je tudi verzija PBZ1{-}pbz0|| | ||||||
|  | O_zanikanje|<oznaka>pogosto zanikan</oznaka>|||||||||LBS-101|<!-- LBS-101 excluded (O_zanikanje) - UNARY: indicates presence of negation -->||| | ||||||
|  | O_količina|<oznaka>s količino</oznaka>|||||||||LBS-102|<!-- LBS-102 excluded (O_količina) - UNARY: indicates presence of numeration -->||| | ||||||
|  | S_veznik_dvob|<struktura>dvobesedni veznik</struktura>|||||||||LBS-103|<!-- LBS-103 excluded (S_veznik_dvob) - COLLOC: indicates presence of a double conjunction -->||| | ||||||
|  | S_d_sam_d|<struktura>z dvema predlogoma</struktura>|||||||||LBS-104|<!-- LBS-104 excluded (S_d_sam_d) - COLLOC: indicates presence of two prepositions -->|struktura ali vzorec?|| | ||||||
|  | S_gl_K_sam|<struktura>predlog s števnikom</struktura>|||||||||LBS-105|<!-- LBS-105 excluded (S_gl_K_sam) - COLLOC: indicates presence of a numeral -->|je tole sploh pravilno zapisano?|| | ||||||
|  | S_gl_K_sam|<struktura>zveze s števniki</struktura>|||||||||LBS-105|<!-- LBS-105 excluded (S_gl_K_sam) - COLLOC: indicates presence of a numeral -->|Simon, tu je treba pogledati š (je čudno napisan)|| | ||||||
| 
 | 
							
								
								
									
										59
									
								
								conversion_utils/tei_to_dictionary.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								conversion_utils/tei_to_dictionary.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,59 @@ | |||||||
|  | import argparse | ||||||
|  | import lxml.etree as lxml | ||||||
|  | 
 | ||||||
|  | from conversion_utils.utils import xpath_find, get_xml_id, TEI_NAMESPACE_QUALIFIER | ||||||
|  | 
 | ||||||
|  | def get_parsed_unit_string(parsed_unit): | ||||||
|  |     elements = xpath_find(parsed_unit, 'tei:w|tei:pc') | ||||||
|  |     return ''.join([e.text if e.get('join') == 'right' else e.text + ' ' for e in elements]).strip() | ||||||
|  | 
 | ||||||
|  | def convert(input_file_name, output_file_name): | ||||||
|  | 
 | ||||||
|  |     output_root = lxml.Element('dictionary') | ||||||
|  | 
 | ||||||
|  |     parser = lxml.XMLParser(remove_blank_text=True) | ||||||
|  |     input_root = lxml.parse(input_file_name, parser).getroot() | ||||||
|  |     parsed_units = xpath_find(input_root, 'tei:text/tei:body/tei:p/tei:s') | ||||||
|  | 
 | ||||||
|  |     for parsed_unit in parsed_units: | ||||||
|  |         entry = lxml.SubElement(output_root, 'entry') | ||||||
|  |         entry.set('sid', get_xml_id(parsed_unit)) | ||||||
|  |         head = lxml.SubElement(entry, 'head') | ||||||
|  |         headword = lxml.SubElement(head, 'headword') | ||||||
|  |         lemma_text = get_parsed_unit_string(parsed_unit) | ||||||
|  |         lemma = lxml.SubElement(headword, 'lemma') | ||||||
|  |         lemma.text = lemma_text | ||||||
|  |         lexical_unit = lxml.SubElement(head, 'lexicalUnit') | ||||||
|  |         tokens = xpath_find(parsed_unit, 'tei:w|tei:pc') | ||||||
|  |         if (len(tokens) == 1): | ||||||
|  |             token = tokens[0] | ||||||
|  |             lexical_unit.set('type', 'single') | ||||||
|  |             lexeme = lxml.SubElement(lexical_unit, 'lexeme') | ||||||
|  |             if (token.tag == TEI_NAMESPACE_QUALIFIER + 'w'): | ||||||
|  |                 lexeme.set('lemma', token.get('lemma')) | ||||||
|  |             lexeme.set('msd', token.get('ana')[len('mte:'):]) | ||||||
|  |             lexeme.text = token.text | ||||||
|  |         else: | ||||||
|  |             lexical_unit.set('type', 'MWE') | ||||||
|  |             for (index, token) in enumerate(tokens, start=1): | ||||||
|  |                 component = lxml.SubElement(lexical_unit, 'component') | ||||||
|  |                 component.set('num', str(index)) | ||||||
|  |                 lexeme = lxml.SubElement(component, 'lexeme') | ||||||
|  |                 if (token.tag == TEI_NAMESPACE_QUALIFIER + 'w'): | ||||||
|  |                     lexeme.set('lemma', token.get('lemma')) | ||||||
|  |                 lexeme.set('msd', token.get('ana')[len('mte:'):]) | ||||||
|  |                 lexeme.text = token.text | ||||||
|  |         lexical_unit.set('structure_id', str(parsed_unit.get('structure_id'))) | ||||||
|  |         body = lxml.SubElement(entry, 'body') | ||||||
|  |         senseList = lxml.SubElement(body, 'senseList') | ||||||
|  | 
 | ||||||
|  |     output_tree = lxml.ElementTree(output_root) | ||||||
|  |     output_tree.write(output_file_name, encoding='UTF-8', pretty_print=True) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | if (__name__ == '__main__'): | ||||||
|  |     arg_parser = argparse.ArgumentParser(description='Convert TEI to dictionary xml.') | ||||||
|  |     arg_parser.add_argument('-infile', type=str, help='Input TEI xml') | ||||||
|  |     arg_parser.add_argument('-outfile', type=str, help='Output xml in standard cjvt schema') | ||||||
|  |     arguments = arg_parser.parse_args() | ||||||
|  |     convert(input_file_name, output_file_name) | ||||||
							
								
								
									
										49
									
								
								conversion_utils/translate_conllu_jos.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								conversion_utils/translate_conllu_jos.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,49 @@ | |||||||
|  | #!/usr/bin/python3 | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | 
 | ||||||
|  | import argparse | ||||||
|  | import codecs | ||||||
|  | import lxml.etree as lxml | ||||||
|  | from importlib_resources import files | ||||||
|  | 
 | ||||||
|  | from conversion_utils.jos_msds_and_properties import Converter, Msd | ||||||
|  | 
 | ||||||
|  | def get_syn_map(): | ||||||
|  |     dict_file_name = files('conversion_utils.resources').joinpath('dict.xml') | ||||||
|  |     dict_file = codecs.open(dict_file_name, 'r') | ||||||
|  |     root = lxml.parse(dict_file).getroot() | ||||||
|  |     dict_file.close()  | ||||||
|  |     return {syn.get('en'):syn.get('sl') for syn in root.xpath('syns/syn')} | ||||||
|  |      | ||||||
|  | def translate(input_file_name, output_file_name): | ||||||
|  | 
 | ||||||
|  |     syn_map = get_syn_map() | ||||||
|  | 
 | ||||||
|  |     output_file = codecs.open(output_file_name, 'w') | ||||||
|  |     input_file = codecs.open(input_file_name, 'r') | ||||||
|  | 
 | ||||||
|  |     converter = Converter() | ||||||
|  | 
 | ||||||
|  |     for line in input_file: | ||||||
|  |         columns = line.strip().split('\t') | ||||||
|  |         if (len(columns) != 10): | ||||||
|  |             output_file.write(line) | ||||||
|  |         else: | ||||||
|  |             columns[4] = converter.translate_msd(Msd(columns[4], 'en'), 'sl').code | ||||||
|  |             columns[7] = syn_map[columns[7]] | ||||||
|  |             output_file.write('\t'.join(columns) + '\n') | ||||||
|  | 
 | ||||||
|  |     input_file.close() | ||||||
|  |     output_file.close() | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | if (__name__ == '__main__'): | ||||||
|  | 
 | ||||||
|  |     arg_parser = argparse.ArgumentParser(description='Translate JOS msds and dependency labels.') | ||||||
|  |     arg_parser.add_argument('-infile', type=str, help='Input conllu') | ||||||
|  |     arg_parser.add_argument('-outfile', type=str, help='Output conllu') | ||||||
|  |     arguments = arg_parser.parse_args() | ||||||
|  |     input_file_name = arguments.infile | ||||||
|  |     output_file_name = arguments.outfile | ||||||
|  | 
 | ||||||
|  |     translate(input_file_name, output_file_name) | ||||||
| @ -1,4 +1,5 @@ | |||||||
| TEI_NAMESPACE = 'http://www.tei-c.org/ns/1.0' | TEI_NAMESPACE = 'http://www.tei-c.org/ns/1.0' | ||||||
|  | TEI_NAMESPACE_QUALIFIER = '{' + TEI_NAMESPACE + '}' | ||||||
| XML_ID_ATTRIBUTE_NAME = '{http://www.w3.org/XML/1998/namespace}id' | XML_ID_ATTRIBUTE_NAME = '{http://www.w3.org/XML/1998/namespace}id' | ||||||
| 
 | 
 | ||||||
| def xpath_find(element,expression): | def xpath_find(element,expression): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user