Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Krista Liin
TÜveakorpus
Commits
232348c1
Commit
232348c1
authored
Apr 01, 2019
by
osboxes.org
Browse files
korpuse teisendused
parent
5f43d5b4
Changes
5
Hide whitespace changes
Inline
Side-by-side
korpus_sh/COMMANDS
0 → 100644
View file @
232348c1
python3 wrapSH.py -s ./sh/cg.sh -r ./korpus.cg
korpus_sh/sh/cg.sh
View file @
232348c1
#!/bin/sh
ELEMENT_
ID
=
$1
ID
=
$1
SENTENCE
=
$2
echo
"
$SENTENCE
"
\ No newline at end of file
RADA
=
/home/osboxes/bin/EstCG-master
RADAMRF
=
~/bin/vabamorf-master/apps/cmdline/project/unix
RADADCT
=
~/bin/vabamorf-master/dct/binary/
echo
$SENTENCE
\
|
$RADA
/rlausestaja.pl
\
|
$RADA
/wr2json.pl
\
|
$RADAMRF
/etana analyze
-lex
$RADADCT
/et.dct
-guess
\
|
sed
-e
"s/[
\\
]n/
\n
/g"
|
$RADA
/json2mrf.pl
\
|
$RADA
/rtolkija.pl
\
|
$RADA
/pron17.pl
\
|
$RADA
/tcopyrem_kaili.pl
\
|
$RADA
/tkms2cg3.pl
\
| vislcg3
-g
$RADA
/preprocess.rul
\
| vislcg3
-o
-g
$RADA
/clo.rul
\
| vislcg3
-o
-g
$RADA
/morfyhe17.rul
\
| vislcg3
-o
-g
$RADA
/PhVerbs17.rul
\
| vislcg3
-o
-g
$RADA
/pindsyn17.rul
\
| vislcg3
-o
-g
$RADA
/strukt.rul
\
| perl ./util/cgAddId.pl
$ID
korpus_sh/sh/sample.sh
0 → 100755
View file @
232348c1
#!/bin/sh
ELEMENT_ID
=
$1
SENTENCE
=
$2
echo
"
$SENTENCE
"
\ No newline at end of file
korpus_sh/util/cgAddId.pl
0 → 100644
View file @
232348c1
#!/bin/perl
# argument [0] on ID
#std.in sisendist loeme teksti
#asendame kõik <s> -> <s id="ID_0"> <s id="ID_1"> jne
#<s id="ID_0"> asendame <s id="ID">
use
utf8
;
use
strict
;
binmode
(
STDOUT
,
"
:utf8
");
binmode
(
STDIN
,
"
:utf8
");
our
$ID
=
$ARGV
[
0
];
our
$text
=
'';
while
(
<
STDIN
>
)
{
$text
.=
$_
;
}
our
$altered_text
=
'';
our
$i
=
0
;
while
(
$altered_text
ne
$text
)
{
$altered_text
=
$text
;
my
$subst
=
'
<s id="
'
.
$ID
.
'
_
'
.
$i
.
'
">
';
if
(
$i
==
0
)
{
$subst
=
'
<s id="
'
.
$ID
.
'
">
';
}
$text
=~
s/<s>/$subst/
;
$i
++
;
}
print
STDOUT
$text
;
korpus_sh/wrapSH.py
View file @
232348c1
...
...
@@ -85,7 +85,7 @@ for row in tsv_file.read().split('\n'):
arr
=
row
.
split
(
'
\t
'
)
if
len
(
arr
)
>
1
:
if
len
(
arr
[
0
])
and
len
(
arr
[
1
]):
print
([
options
[
'sh_script'
],
'
"
%s
"
'
%
arr
[
0
]
,
'
"
%s
"
'
%
arr
[
1
]]
)
subprocess
.
run
([
options
[
'sh_script'
],
'
"
%s
"
'
%
arr
[
0
]
,
'
"
%s
"
'
%
arr
[
1
]],
stdout
=
outfile
)
print
([
options
[
'sh_script'
],
'%s'
%
arr
[
0
]
,
'%s'
%
arr
[
1
]]
)
subprocess
.
run
([
options
[
'sh_script'
],
'%s'
%
arr
[
0
]
,
'%s'
%
arr
[
1
]],
stdout
=
outfile
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment