File: check_sint_tag.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 (35 lines) | stat: -rwxr-xr-x 859 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
#!/bin/bash

# Check for <sint> consistency

lt-expand apertium-eo-en.en.dix | grep '<sint>' | cut -f2 -d':' | cut -f1 -d'<' | uniq -u > /tmp/sintadj2
n=0;

for line in `cat apertium-eo-en.eo-en.dix |sed 's/ /_/g'`; 
do
  EN=`echo $line | sed 's/<r>/@/g' | cut -f2 -d'@' | cut -f1 -d'<'`; 
#  n=$((n+1))
  echo $line | grep '<s_n="adj"/>' > /dev/null; 
  if [ $? -eq 0 ]; 
  then 
#    echo $line;
    cat /tmp/sintadj2 | grep $EN >/dev/null; 
    if [ $? -eq 0 ]; 
    then
      echo $line | grep '<s_n="sint"/>' > /dev/null; 
      if [ $? -ne 0 ]; 
      then
#        echo Add '<s n="sint">' to $EN  in line $n: $line
        echo Add '<s n="sint">' to $EN  in $line
      fi
    else
      echo $line | grep '<s_n="sint"/>' > /dev/null; 
      if [ $? -eq 0 ]; 
      then
        echo Remove '<s n="sint">' to $EN  in $line
      fi
    fi
  fi
done