Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When converting a partially parsed sentence, raises IndexError if a subreading's missing the label #2

Open
IlnarSelimcan opened this issue Mar 4, 2020 · 0 comments

Comments

@IlnarSelimcan
Copy link

IlnarSelimcan commented Mar 4, 2020

ud-scripts$ cat /tmp/input1 
"<Есірткі>"
	"есірткі" n nom @nmod:poss #1->2
"<бизнесі де>"
	"бизнес" n px3sp nom @nsubj #2->9
		"да" postadv #2->9
"<Орталық>"
	"орталық" n nom @nmod:poss #3->5
"<Азия>"
	"Азия" np top nom @nmod:poss #4->5
"<аймағы>"
	"аймақ" n px3sp nom @nsubj #5->9
"<үшін>"
	"үшін" post #6->9
"<қауіп>"
	"қауіп" n nom @nsubj #7->9
"<болып>"
	"бол" v iv prc_perf @cop #8->9
"<отыр>"
	"отыр" vaux pres p3 sg @root #9->0
"<.>"
	"." sent @punct #10->9


ud-scripts$ cat /tmp/input1 | python3 vislcg3-to-conllu.py "text = "
# sent_id = text =:1:0
# text = Есірткі бизнесі де Орталық Азия аймағы үшін қауіп болып отыр.
1	Есірткі	есірткі	_	n	nom	2	nmod:poss	_	_
2-3	бизнесі де	_	_	_	_	_	_	_	_
2	бизнесі	бизнес	_	n	px3sp|nom	9	nsubj	_	_
Traceback (most recent call last):
  File "vislcg3-to-conllu.py", line 309, in <module>
    (newtok, newchar) = kasitella(blokk, t);
  File "vislcg3-to-conllu.py", line 269, in kasitella
    (tc, cc) = trykk(buffer, tokcount, charcount, t);
  File "vislcg3-to-conllu.py", line 192, in trykk
    etiqueta = rfunc.findall(llinia)[0].strip();
IndexError: list index out of range


ud-scripts$ cat /tmp/input2 
"<Есірткі>"
	"есірткі" n nom @nmod:poss #1->2
"<бизнесі де>"
	"бизнес" n px3sp nom @nsubj #2->9
		"да" postadv @foo #2->9
"<Орталық>"
	"орталық" n nom @nmod:poss #3->5
"<Азия>"
	"Азия" np top nom @nmod:poss #4->5
"<аймағы>"
	"аймақ" n px3sp nom @nsubj #5->9
"<үшін>"
	"үшін" post #6->9
"<қауіп>"
	"қауіп" n nom @nsubj #7->9
"<болып>"
	"бол" v iv prc_perf @cop #8->9
"<отыр>"
	"отыр" vaux pres p3 sg @root #9->0
"<.>"
	"." sent @punct #10->9


ud-scripts$ cat /tmp/input2 | python3 vislcg3-to-conllu.py "text = "
# sent_id = text =:1:0
# text = Есірткі бизнесі де Орталық Азия аймағы үшін қауіп болып отыр.
1	Есірткі	есірткі	_	n	nom	2	nmod:poss	_	_
2-3	бизнесі де	_	_	_	_	_	_	_	_
2	бизнесі	бизнес	_	n	px3sp|nom	9	nsubj	_	_
3	де	да	_	postadv	_	9	foo	_	_
4	Орталық	орталық	_	n	nom	5	nmod:poss	_	_
5	Азия	Азия	_	np	top|nom	5	nmod:poss	_	_
6	аймағы	аймақ	_	n	px3sp|nom	9	nsubj	_	_
7	үшін	үшін	_	post	_	9	X	_	_
8	қауіп	қауіп	_	n	nom	9	nsubj	_	_
9	болып	бол	_	v	iv|prc_perf	9	cop	_	_
10	отыр	отыр	_	vaux	pres|p3|sg	0	root	_	_
11	.	.	_	sent	_	9	punct	_	_

# sent_id = text =:2:21
# text = 
IlnarSelimcan added a commit to taruen/ud-scripts that referenced this issue Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant