Skip to content

Commit 6d83af4

Browse files
committed
Add some infinitives with clitics from a user who found some infinitive tokenization errors stanfordnlp/stanza#1401
1 parent b8d4e74 commit 6d83af4

File tree

3 files changed

+298
-1
lines changed

3 files changed

+298
-1
lines changed

spanish-mwt/infinitives.mwt

+230
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
# sent_id = 0
2+
# text = juntarse.
3+
1-2 juntarse _ _ _ _ _ _ _ SpaceAfter=No
4+
1 juntar juntar VERB _ VerbForm=Inf 0 root _ _
5+
2 se él PRON _ Case=Acc|Person=3|PrepCase=Npr|PronType=Prs|Reflex=Yes 1 obj _ _
6+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
7+
8+
# sent_id = 1
9+
# text = Juntarse.
10+
1-2 Juntarse _ _ _ _ _ _ _ SpaceAfter=No
11+
1 Juntar juntar VERB _ VerbForm=Inf 0 root _ _
12+
2 se él PRON _ Case=Acc|Person=3|PrepCase=Npr|PronType=Prs|Reflex=Yes 1 obj _ _
13+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
14+
15+
# sent_id = 2
16+
# text = Decírselo.
17+
1-3 Decírselo _ _ _ _ _ _ _ SpaceAfter=No
18+
1 Decir decir VERB _ VerbForm=Inf 0 root _ _
19+
2 se él PRON _ _ 1 _ _ _
20+
3 lo él PRON _ _ 2 _ _ _
21+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
22+
23+
# sent_id = 3
24+
# text = decírselo.
25+
1-3 decírselo _ _ _ _ _ _ _ SpaceAfter=No
26+
1 decir decir VERB _ VerbForm=Inf 0 root _ _
27+
2 se él PRON _ _ 1 _ _ _
28+
3 lo él PRON _ _ 2 _ _ _
29+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
30+
31+
# sent_id = 4
32+
# text = Decírmelo.
33+
1-3 Decírmelo _ _ _ _ _ _ _ SpaceAfter=No
34+
1 Decir decir VERB _ VerbForm=Inf 0 root _ _
35+
2 me él PRON _ _ 1 _ _ _
36+
3 lo él PRON _ _ 2 _ _ _
37+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
38+
39+
# sent_id = 5
40+
# text = decírmelo.
41+
1-3 decírmelo _ _ _ _ _ _ _ SpaceAfter=No
42+
1 decir decir VERB _ VerbForm=Inf 0 root _ _
43+
2 me él PRON _ _ 1 _ _ _
44+
3 lo él PRON _ _ 2 _ _ _
45+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
46+
47+
# sent_id = 6
48+
# text = Dárselo.
49+
1-3 Dárselo _ _ _ _ _ _ _ SpaceAfter=No
50+
1 Dar dar VERB _ VerbForm=Inf 0 root _ _
51+
2 se él PRON _ _ 1 _ _ _
52+
3 lo él PRON _ _ 2 _ _ _
53+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
54+
55+
# sent_id = 7
56+
# text = dárselo.
57+
1-3 dárselo _ _ _ _ _ _ _ SpaceAfter=No
58+
1 dar dar VERB _ VerbForm=Inf 0 root _ _
59+
2 se él PRON _ _ 1 _ _ _
60+
3 lo él PRON _ _ 2 _ _ _
61+
4 . . PUNCT _ PunctType=Peri 1 punct _ _
62+
63+
# sent_id = 8
64+
# text = atarlos.
65+
1-2 atarlos _ _ _ _ _ _ _ SpaceAfter=No
66+
1 atar atar VERB _ VerbForm=Inf 0 root _ _
67+
2 los él PRON _ _ 1 obj _ _
68+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
69+
70+
# sent_id = 9
71+
# text = Atarlos.
72+
1-2 Atarlos _ _ _ _ _ _ _ SpaceAfter=No
73+
1 Atar atar VERB _ VerbForm=Inf 0 root _ _
74+
2 los él PRON _ _ 1 obj _ _
75+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
76+
77+
# sent_id = 10
78+
# text = besarlos.
79+
1-2 besarlos _ _ _ _ _ _ _ SpaceAfter=No
80+
1 besar besar VERB _ VerbForm=Inf 0 root _ _
81+
2 los él PRON _ _ 1 obj _ _
82+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
83+
84+
# sent_id = 11
85+
# text = Besarlos.
86+
1-2 Besarlos _ _ _ _ _ _ _ SpaceAfter=No
87+
1 Besar besar VERB _ VerbForm=Inf 0 root _ _
88+
2 los él PRON _ _ 1 obj _ _
89+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
90+
91+
# sent_id = 12
92+
# text = compartirlos.
93+
1-2 compartirlos _ _ _ _ _ _ _ SpaceAfter=No
94+
1 compartir compartir VERB _ VerbForm=Inf 0 root _ _
95+
2 los él PRON _ _ 1 obj _ _
96+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
97+
98+
# sent_id = 13
99+
# text = Compartirlos.
100+
1-2 Compartirlos _ _ _ _ _ _ _ SpaceAfter=No
101+
1 Compartir compartir VERB _ VerbForm=Inf 0 root _ _
102+
2 los él PRON _ _ 1 obj _ _
103+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
104+
105+
# sent_id = 14
106+
# text = decirlos.
107+
1-2 decirlos _ _ _ _ _ _ _ SpaceAfter=No
108+
1 decir decir VERB _ VerbForm=Inf 0 root _ _
109+
2 los él PRON _ _ 1 obj _ _
110+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
111+
112+
# sent_id = 15
113+
# text = Decirlos.
114+
1-2 Decirlos _ _ _ _ _ _ _ SpaceAfter=No
115+
1 Decir decir VERB _ VerbForm=Inf 0 root _ _
116+
2 los él PRON _ _ 1 obj _ _
117+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
118+
119+
# sent_id = 16
120+
# text = haberlos.
121+
1-2 haberlos _ _ _ _ _ _ _ SpaceAfter=No
122+
1 haber haber VERB _ VerbForm=Inf 0 root _ _
123+
2 los él PRON _ _ 1 obj _ _
124+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
125+
126+
# sent_id = 17
127+
# text = Haberlos.
128+
1-2 Haberlos _ _ _ _ _ _ _ SpaceAfter=No
129+
1 Haber haber VERB _ VerbForm=Inf 0 root _ _
130+
2 los él PRON _ _ 1 obj _ _
131+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
132+
133+
# sent_id = 18
134+
# text = hacerlos.
135+
1-2 hacerlos _ _ _ _ _ _ _ SpaceAfter=No
136+
1 hacer hacer VERB _ VerbForm=Inf 0 root _ _
137+
2 los él PRON _ _ 1 obj _ _
138+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
139+
140+
# sent_id = 19
141+
# text = Hacerlos.
142+
1-2 Hacerlos _ _ _ _ _ _ _ SpaceAfter=No
143+
1 Hacer hacer VERB _ VerbForm=Inf 0 root _ _
144+
2 los él PRON _ _ 1 obj _ _
145+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
146+
147+
# sent_id = 20
148+
# text = invadirlos.
149+
1-2 invadirlos _ _ _ _ _ _ _ SpaceAfter=No
150+
1 invadir invadir VERB _ VerbForm=Inf 0 root _ _
151+
2 los él PRON _ _ 1 obj _ _
152+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
153+
154+
# sent_id = 21
155+
# text = Invadirlos.
156+
1-2 Invadirlos _ _ _ _ _ _ _ SpaceAfter=No
157+
1 Invadir invadir VERB _ VerbForm=Inf 0 root _ _
158+
2 los él PRON _ _ 1 obj _ _
159+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
160+
161+
# sent_id = 22
162+
# text = llamarlos.
163+
1-2 llamarlos _ _ _ _ _ _ _ SpaceAfter=No
164+
1 llamar llamar VERB _ VerbForm=Inf 0 root _ _
165+
2 los él PRON _ _ 1 obj _ _
166+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
167+
168+
# sent_id = 23
169+
# text = Llamarlos.
170+
1-2 Llamarlos _ _ _ _ _ _ _ SpaceAfter=No
171+
1 Llamar llamar VERB _ VerbForm=Inf 0 root _ _
172+
2 los él PRON _ _ 1 obj _ _
173+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
174+
175+
# sent_id = 24
176+
# text = saberlos.
177+
1-2 saberlos _ _ _ _ _ _ _ SpaceAfter=No
178+
1 saber saber VERB _ VerbForm=Inf 0 root _ _
179+
2 los él PRON _ _ 1 obj _ _
180+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
181+
182+
# sent_id = 25
183+
# text = Saberlos.
184+
1-2 Saberlos _ _ _ _ _ _ _ SpaceAfter=No
185+
1 Saber saber VERB _ VerbForm=Inf 0 root _ _
186+
2 los él PRON _ _ 1 obj _ _
187+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
188+
189+
# sent_id = 26
190+
# text = tenerlos.
191+
1-2 tenerlos _ _ _ _ _ _ _ SpaceAfter=No
192+
1 tener tener VERB _ VerbForm=Inf 0 root _ _
193+
2 los él PRON _ _ 1 obj _ _
194+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
195+
196+
# sent_id = 27
197+
# text = Tenerlos.
198+
1-2 Tenerlos _ _ _ _ _ _ _ SpaceAfter=No
199+
1 Tener tener VERB _ VerbForm=Inf 0 root _ _
200+
2 los él PRON _ _ 1 obj _ _
201+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
202+
203+
# sent_id = 28
204+
# text = usarlos.
205+
1-2 usarlos _ _ _ _ _ _ _ SpaceAfter=No
206+
1 usar usar VERB _ VerbForm=Inf 0 root _ _
207+
2 los él PRON _ _ 1 obj _ _
208+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
209+
210+
# sent_id = 29
211+
# text = Usarlos.
212+
1-2 Usarlos _ _ _ _ _ _ _ SpaceAfter=No
213+
1 Usar usar VERB _ VerbForm=Inf 0 root _ _
214+
2 los él PRON _ _ 1 obj _ _
215+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
216+
217+
# sent_id = 30
218+
# text = verlos.
219+
1-2 verlos _ _ _ _ _ _ _ SpaceAfter=No
220+
1 ver ver VERB _ VerbForm=Inf 0 root _ _
221+
2 los él PRON _ _ 1 obj _ _
222+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
223+
224+
# sent_id = 31
225+
# text = Verlos.
226+
1-2 Verlos _ _ _ _ _ _ _ SpaceAfter=No
227+
1 Ver ver VERB _ VerbForm=Inf 0 root _ _
228+
2 los él PRON _ _ 1 obj _ _
229+
3 . . PUNCT _ PunctType=Peri 1 punct _ _
230+

spanish-mwt/infinitives.py

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
"""
2+
Goal:
3+
4+
Add infinitives with pronouns on the end to the Spanish combined dataset
5+
6+
verlos
7+
hacerlos
8+
haberlos
9+
etc etc
10+
11+
Starting from a list in this issue:
12+
13+
https://github.com/stanfordnlp/stanza/issues/1401
14+
"""
15+
16+
from stanza.utils.conll import CoNLL
17+
18+
starter = CoNLL.conll2doc("handpicked.mwt")
19+
20+
VERBS = [
21+
"atar",
22+
"besar",
23+
"compartir",
24+
"decir",
25+
"haber",
26+
"hacer",
27+
"invadir",
28+
"llamar",
29+
"saber",
30+
"tener",
31+
"usar",
32+
"ver",
33+
]
34+
35+
sent_id = int(starter.sentences[-1].sent_id)
36+
37+
new_sentences = []
38+
for verb in VERBS:
39+
sent_id += 1
40+
mwt = ["1-2", "%slos" % verb, "_", "_", "_", "_", "_", "_", "_", "SpaceAfter=No"]
41+
inf = ["1", verb, verb, "VERB", "_", "VerbForm=Inf", "0", "root", "_", "_"]
42+
sentence = [
43+
"# sent_id = %d" % sent_id,
44+
"# text = %slos." % verb,
45+
"\t".join(mwt),
46+
"\t".join(inf),
47+
"2 los él PRON _ _ 1 obj _ _",
48+
"3 . . PUNCT _ PunctType=Peri 1 punct _ _"
49+
]
50+
new_sentences.append("\n".join(sentence))
51+
52+
sent_id += 1
53+
Verb = verb[0].upper() + verb[1:]
54+
sentence[0] = "# sent_id = %d" % sent_id
55+
sentence[1] = "# text = %slos." % Verb
56+
mwt[1] = Verb + "los"
57+
sentence[2] = "\t".join(mwt)
58+
inf[1] = Verb
59+
sentence[3] = "\t".join(inf)
60+
new_sentences.append("\n".join(sentence))
61+
62+
print("{:C}".format(starter))
63+
print()
64+
65+
for sentence in new_sentences:
66+
print(sentence)
67+
print()

spanish-mwt/mwt_script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pandas as pd
66
import random
77

8-
with open("handpicked.mwt", encoding='utf-8') as fin:
8+
with open("infinitives.mwt", encoding='utf-8') as fin:
99
starter = fin.read()
1010

1111
mwt_strings = starter.strip().split("\n\n")

0 commit comments

Comments
 (0)