File: multi-gen.sh

package info (click to toggle)
apertium-eo-en 1.0.0~r63833-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 28,044 kB
  • sloc: xml: 32,398; python: 364; sh: 318; makefile: 131
file content (86 lines) | stat: -rwxr-xr-x 2,329 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash

if [ $# -lt 1 ]; then
	echo 'Usage: sh multi-gen.sh <file>';
	exit;
fi

if [ ! -f $1 ]; then
	exit;	
fi

echo '  <section id="multiwords" type="standard">';
for word in `cat $1 | sed 's/ /<b\/>/g'`; do 
	echo '    <!-- '`echo $word | sed 's/<b\/>/ /g'`' -->';
	# Singular, nominative
	echo '    <e>';
	echo '      <p>';
	echo '        <l>'$word'</l>';
	echo '        <r>'$word'<s n="n"/><s n="sg"/><s n="nom"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Singular, accusative
	echo '    <e>';
	echo '      <p>';
	echo '        <l>'`echo $word | sed 's/<b\/>/n<b\/>/g' | sed 's/$/n/g'`'</l>';
	echo '        <r>'$word'<s n="n"/><s n="sg"/><s n="acc"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Plural, nominative
	echo '    <e>';
	echo '      <p>';
	echo '        <l>'`echo $word | sed 's/<b\/>/j<b\/>/g' | sed 's/$/j/g'`'</l>';
	echo '        <r>'$word'<s n="n"/><s n="pl"/><s n="nom"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Plural, accusative
	echo '    <e>';
	echo '      <p>';
	echo '        <l>'`echo $word | sed 's/<b\/>/jn<b\/>/g' | sed 's/$/jn/g'`'</l>';
	echo '        <r>'$word'<s n="n"/><s n="pl"/><s n="acc"/></r>';
	echo '      </p>';
	echo '    </e>';





	echo '    <!-- adjektiva formo de '`echo $word | sed 's/<b\/>/ /g'`' -->';
	word2=`echo $word | sed 's/a<b\/>/-/' | sed 's/o$/a/'` ;
	# Singular, nominative
	echo '    <e r="RL">';
	echo '      <p>';
	echo '        <l>'$word2'</l>';
	echo '        <r>'$word'<s n="adj"/><s n="sg"/><s n="nom"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Singular, accusative
	echo '    <e r="RL">';
	echo '      <p>';
	echo '        <l>'`echo $word2 | sed 's/<b\/>/n<b\/>/g' | sed 's/$/n/g'`'</l>';
	echo '        <r>'$word'<s n="adj"/><s n="sg"/><s n="acc"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Plural, nominative
	echo '    <e r="RL">';
	echo '      <p>';
	echo '        <l>'`echo $word2 | sed 's/<b\/>/j<b\/>/g' | sed 's/$/j/g'`'</l>';
	echo '        <r>'$word'<s n="adj"/><s n="pl"/><s n="nom"/></r>';
	echo '      </p>';
	echo '    </e>';

	# Plural, accusative
	echo '    <e r="RL">';
	echo '      <p>';
	echo '        <l>'`echo $word2 | sed 's/<b\/>/jn<b\/>/g' | sed 's/$/jn/g'`'</l>';
	echo '        <r>'$word'<s n="adj"/><s n="pl"/><s n="acc"/></r>';
	echo '      </p>';
	echo '    </e>';

done
echo '  </section>';