Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3f80400

Browse files
Fix verbal "fixed" expressions in Romanian.
1 parent 7259c87 commit 3f80400

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎udapi/block/ud/ro/fixfixed.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""Block ud.ro.FixFixed
2+
3+
Author: Dan Zeman
4+
"""
5+
import logging
6+
7+
from udapi.core.block import Block
8+
9+
10+
class FixFixed(Block):
11+
"""Block for fixing verbal 'fixed' expressions."""
12+
13+
def process_node(self, node):
14+
if node.upos=='VERB':
15+
fixchildren = [x for x in node.children if x.udeprel=='fixed']
16+
nfc = len(fixchildren)
17+
if nfc==1 and fixchildren[0].upos == 'NOUN':
18+
fixchildren[0].deprel = 'obj'
19+
elif nfc==2 and fixchildren[1].upos == 'NOUN':
20+
fixchildren[0].parent = fixchildren[1]
21+
fixchildren[0].deprel = 'case'
22+
fixchildren[1].deprel = 'obl'
23+
elif nfc>0:
24+
logging.info('Another case: '+node.lemma+' '+' '.join([x.form for x in fixchildren]))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /