-
Notifications
You must be signed in to change notification settings - Fork 7
/
buildgael
35 lines (33 loc) · 1.05 KB
/
buildgael
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
#!/bin/bash
PLAIN=${HOME}/seal/ig7
if [ ${HOME}/math/code/data/Dictionary/IG -nt ${PLAIN} ]
then
echo "You may want to rerun ig7" >&2
fi
do_it()
{
cat ${PLAIN} | egrep '^[A-Z][^.]*\. n' |
egrep -v '\[in phrase\]' | egrep -v ':.*(Mrs?|St)\. ' |
egrep -v 'is\. nb2' | egrep -v '[ao]ch(as)?\. nf1' |
sed 's/ ([^)]*)//g' |
egrep '[:,] [A-Z][^ ,.]*[,.][^:]*$' |
sed 's/\[[^]]*\]//g' |
sed 's/^\([^.]*\)\.[^:]*:/\1:/' |
sed 's/\([:,]\) [^.,]* [^,.]*[,.]/\1/' |
sed 's/\([:,]\) [^.,]* [^,.]*[,.]/\1/' |
sed 's/\([:,]\) [^.,]* [^,.]*[,.]/\1/' |
sed 's/\([:,]\) [^.,]* [^,.]*[,.]/\1/' |
egrep -v '^(Poncán|Oileán Úr|Bás|Seán Buí|Coimdhe|Fear Thuas|Gaeilge:|Scot|Madonna|Sior)' |
while read x
do
IRISH=`echo "${x}" | sed 's/:.*//'`
echo "${x}" | sed 's/^[^:]*: //' | tr "," "\n" | egrep '[a-z]' | # note require lowercase here; don't want "SDLP", "GAA", etc.
egrep '[A-Z]' | # require uppercase to avoid "yuletide"
sed 's/[. ]*$//' |
while read def
do
echo "${def} ${IRISH}"
done
done
}
(cat gaelu.in; cat miotas stair | egrep -v '^:' | sed 's/:/ /'; do_it) | sort -u