Commit 319ab5b0 authored by Damyan Ivanov's avatar Damyan Ivanov

Imported Upstream version 4.1

parent 3513f08c
4.1 10.12.2007
=================
* <b.manolov@web.de>
2 . 79a
84a, . 79b
() 84, .
79a 79b .
* 700 .
4.0 01.04.2004
=================
* 2 000 .
65 000 .
* .
*
.
* .
.
*
http://kbedic.sourceforge.net.
3.0 24.05.2003
=================
* 10 000 .
......
......@@ -36,7 +36,7 @@ http://dabuzzard.250free.com/enbg.zip.
. 5 000 - 10 000
. -
.
.
.
,
,
.
......
,
bgOffice, .
,
,
.
<eto@mb.bia-bg.com>
......
......@@ -6,21 +6,3 @@
,
.
, .
*
.
,
.
* , , ,
. . ..
.
* ()
. .
.
* Perl
.
, OpenOffice.org
.
#!/usr/bin/perl
use strict;
require "../lib/bgoffice_util_module.pm";
if ($ARGV[0] eq "--help") {
print <<EOHelp;
:
SFX K .
SFX K a
()
.
.
EOHelp
exit;
}
my @data = <STDIN>;
chop(@data);
my $old_line = "";
for (@data) {
my $line = $_;
my $beg = substr($_, 0, 3);
if ($beg eq "SET") {
print "SET windows-1251\n";
next;
}
if (($beg eq "MAP") || ($beg eq "REP")) {
exit;
}
if (($_ eq "") && ($old_line eq "")) {
next;
}
if ((length($line) == 29) && (substr($line, 28, 1) eq ".") && (substr($line, 8, 1) ne "0")) {
print substr($line, 0, 28);
print strip_line(substr($line, 8, 10));
print "\n";
} else {
print "$_\n";
}
$old_line = $_;
}
......@@ -28,30 +28,34 @@ BEGIN {
}
/SFX/ {
if ($5 == "") {
flag=$2;
print "";
if ($3 == "Y") {
printf "flag *%s:\n", flag;
} else {
printf "flag ~%s:\n", flag;
if (($1 != "MAP") && ($1 != "REP")) {
if ($5 == "") {
flag=$2;
print "";
if ($3 == "Y") {
printf "flag *%s:\n", flag;
} else {
printf "flag ~%s:\n", flag;
}
}
}
if ($5 != "") {
strip_str = "-" cyrtoupper($3) ",";
if (strip_str == "-0,") {
strip_str = "";
}
append_str = cyrtoupper($4);
if (append_str == "0") {
append_str = "-";
}
condition = $5;
if (condition == "." && $3 != "0") {
condition = cyrtoupper($3);
gsub (/./, "& ", condition);
if ($5 != "") {
strip_str = "-" cyrtoupper($3) ",";
if (strip_str == "-0,") {
strip_str = "";
}
append_str = cyrtoupper($4);
if (append_str == "0") {
append_str = "-";
}
condition = $5;
if ((condition == "." && $3 != "0") || (condition != ".")) {
if (condition == ".") {
condition = cyrtoupper($3);
}
gsub (/./, "& ", condition);
}
printf " %-8s > %s%s\n", condition, strip_str, append_str;
}
printf " %-8s > %s%s\n", condition, strip_str, append_str;
}
}
......
#
# .
# .
#
# ,
# TRY, bg_BG.aff.
#
# <anton@lml.bas.bg>
#
MAP a
MAP eu
MAP oy
MAP n
MAP
MAP k
MAP g
MAP
MAP
MAP p
MAP c
MAP x
MAP A
MAP E
MAP O0
MAP
MAP B
MAP K
MAP T
MAP
MAP 3C
MAP M
MAP H
MAP P
MAP Y
MAP X
call build_OOo_affix.bat
call build_OOo_dictionary.bat
perl build_OOo_affix_header.pl > bg_BG.aff
perl build_OOo_affix_step_1.pl > a.tmp
sort < a.tmp > b.tmp
uniq < b.tmp > a.tmp
perl build_OOo_affix_step_2.pl < a.tmp >> bg_BG.aff
rm -f *.tmp
......@@ -2,11 +2,14 @@
perl build_OOo_affix_header.pl > bg_BG.aff
perl build_OOo_affix_step_1.pl > a.tmp
perl build_OOo_affix_step_1.pl > a.tmp
sort < a.tmp > b.tmp
uniq < b.tmp > a.tmp
perl build_OOo_affix_step_2.pl < a.tmp >> bg_BG.aff
perl build_OOo_affix_step_2.pl < a.tmp >> bg_BG.aff
perl build_OOo_affix_step_3.pl < OOo_add_to_bg_BG_aff.map >> bg_BG.aff
rm -f *.tmp
......@@ -59,6 +59,9 @@ print "TRY ";
my $tt = 0;
my $max = 10000000;
my $lo_case = "";
my $up_case = "";
for (my $i = 0; $i <= $#t; $i++) {
my $curmax = -1;
for (my $j = 0; $j <= $#t; $j++) {
......@@ -68,8 +71,9 @@ for (my $i = 0; $i <= $#t; $i++) {
}
$max = $curmax;
for (my $j = 0; $j <= $#t; $j++) {
if ($curmax == $t[$j]) {
print chr(ord("") + $j);
if (($curmax == $t[$j]) && ($curmax > 0)) {
$lo_case .= chr(ord("") + $j);
$up_case .= chr(ord("") + $j);
}
}
$tt += $t[$i];
......@@ -78,4 +82,4 @@ for (my $i = 0; $i <= $#t; $i++) {
# Just for the record!
# print "total number of chars: $tt\n";
print "\n\n";
print $lo_case . $up_case . "\n\n";
......@@ -89,6 +89,11 @@ sub print_line() {
my ($f, $e, $l) = @_;
if (($f ne $e) && ($e ne "-")) {
print "SFX $l $f", substr($spaces, 0, 10 - length($f));
print $e, substr($spaces, 0, 10 - length($e)), ".\n";
my $condition = ".";
if ($f ne "0") {
$condition = $f;
}
$condition = ".";
print $e, substr($spaces, 0, 10 - length($e)), "$condition\n";
}
}
#!/usr/bin/perl
use strict;
require "../lib/bgoffice_util_module.pm";
if ($ARGV[0] eq "--help") {
print <<EOHelp;
bg_BG.aff.
MAP REP.
, , .
.
,
OOo_add_to_bg_BG_aff.map
OOo_add_to_bg_BG_aff.rep ( )
bg_BG.aff.
EOHelp
exit;
}
my @data = <STDIN>;
chop(@data);
my $buf = "";
my $i = 0;
for (@data) {
my $beg = substr($_, 0, 3);
if (($beg eq "MAP") || ($beg eq "REP")) {
$buf .= $_ . "\n";
$i++;
}
}
print "\n\n" . substr($buf, 0, 3) . " $i\n";
print "$buf";
perl build_OOo_dictionary_step_1.pl > a.tmp
sort < a.tmp > b.tmp
uniq < b.tmp > a.tmp
perl build_OOo_dictionary_step_2.pl > b.tmp
sort < b.tmp > c.tmp
uniq < c.tmp > b.tmp
perl build_OOo_dictionary_step_3.pl < b.tmp >> a.tmp
sort < a.tmp > b.tmp
uniq < b.tmp > a.tmp
perl build_OOo_dictionary_step_4.pl < a.tmp > b.tmp
rem *********************************************
rem Under Win is perl -e " ... "
rem Under *nix is perl -e ' ... '
rem Also under *nix can be done by bash
rem *********************************************
rem perl -e 'my $num = `wc -l b.tmp`; chop($num); $num =~ s/\D//g; $num--; print $num;' > a.tmp
perl -e "my $num = `wc -l b.tmp`; chop($num); $num =~ s/\D//g; $num--; print $num;" > a.tmp
cat a.tmp b.tmp > bg_BG.dic
rm -f *.tmp
......@@ -12,7 +12,8 @@ uniq < c.tmp > b.tmp
perl build_OOo_dictionary_step_3.pl < b.tmp >> a.tmp
sort < a.tmp > b.tmp
# Sort in C locale as author of aspell recomends it
LC_ALL=C sort < a.tmp > b.tmp
uniq < b.tmp > a.tmp
perl build_OOo_dictionary_step_4.pl < a.tmp > b.tmp
......
perl build_aspell_dictionary.pl > a.tmp
sort < a.tmp > b.tmp
uniq < b.tmp > bg_words.dat
rm -f *.tmp
......@@ -2,7 +2,8 @@
perl build_aspell_dictionary.pl > a.tmp
sort < a.tmp > b.tmp
# Sort in C locale as author of aspell recomends it
LC_ALL=C sort < a.tmp > b.tmp
uniq < b.tmp > bg_words.dat
rm -f *.tmp
......@@ -9,5 +9,4 @@ echo "Converting data ..."
./OOo2ispell.awk < bg_BG.aff > bulgarian.aff
tail +2 < bg_BG.dic | sort -t/ -k1,1 -f > bulgarian.dict
tail -n +2 < bg_BG.dic | LC_ALL=C sort -t/ -k1,1 -f > bulgarian.dict
#!/bin/bash
if ((!(test -e "bg_BG.aff")) || (!(test -e "bg_BG.dic"))); then
echo "Building OOo affix and dictionary files first! Please wait ..."
./build_OOo.sh
fi
echo "Converting data ..."
./OOo2Mozilla.pl < bg_BG.aff > bg.aff
cp bg_BG.dic bg.dic
......@@ -40,8 +40,9 @@ while ($file_name = next_file($file_name)) {
my @e = get_endings($file_name);
my $f = $e[0];
my @w = get_words($file_name);
my $words = $#w + 1;
print "$type, $num, $#w, ";
print "$type, $num, $words, ";
my $aff = -1;
for (@e) {
......@@ -51,7 +52,7 @@ while ($file_name = next_file($file_name)) {
}
print "$aff, ";
my $total = $aff * $#w;
my $total = $aff * $words;
print "$total, ";
if ($f =~ /(.*)\[(.+)\](.*)/) {
......
echo > result.txt
echo ************************************************************ >> result.txt
echo ***** >> result.txt
echo ***** Check Permissible Chars >> result.txt
echo ***** >> result.txt
echo ************************************************************ >> result.txt
perl check_permissible_chars.pl >> result.txt
echo >> result.txt
echo >> result.txt
echo >> result.txt
echo ************************************************************ >> result.txt
echo ***** >> result.txt
echo ***** Check Endings Aginst Forms >> result.txt
echo ***** >> result.txt
echo ************************************************************ >> result.txt
perl check_endings_aginst_forms.pl >> result.txt
echo >> result.txt
echo >> result.txt
echo >> result.txt
echo ************************************************************ >> result.txt
echo ***** >> result.txt
echo ***** Check Test Cases >> result.txt
echo ***** >> result.txt
echo ************************************************************ >> result.txt
perl check_test_cases.pl >> result.txt
echo >> result.txt
echo >> result.txt
echo >> result.txt
echo ************************************************************ >> result.txt
echo ***** >> result.txt
echo ***** Check Words Aginst Filter >> result.txt
echo ***** >> result.txt
echo ************************************************************ >> result.txt
perl check_words_aginst_filter.pl >> result.txt
#!/bin/bash
echo ""
echo "************************************************************"
echo "*****"
echo "***** Check Permissible Chars"
echo "*****"
echo "************************************************************"
perl check_permissible_chars.pl
if (test "$1" = "--verbose"); then
echo "Checking Permissible Chars..."
fi
perl check_permissible_chars.pl $1
if (test "$1" = "--verbose"); then
echo "Checking Endings Aginst Forms..."
fi
perl check_endings_aginst_forms.pl $1
echo ""
echo ""
echo ""
echo "************************************************************"
echo "*****"
echo "***** Check Endings Aginst Forms"
echo "*****"
echo "************************************************************"
perl check_endings_aginst_forms.pl
if (test "$1" = "--verbose"); then
echo "Checking Test Cases..."
fi
perl check_test_cases.pl $1
echo ""
echo ""
echo ""
echo "************************************************************"
echo "*****"
echo "***** Check Test Cases"
echo "*****"
echo "************************************************************"
perl check_test_cases.pl
echo ""
echo ""
echo ""
echo "************************************************************"
echo "*****"
echo "***** Check Words Aginst Filter"
echo "*****"
echo "************************************************************"
perl check_words_aginst_filter.pl
if (test "$1" = "--verbose"); then
echo "Checking Words Aginst Filter..."
fi
perl check_words_aginst_filter.pl $1
......@@ -22,6 +22,8 @@ EOHelp
}
my $verbose = ($ARGV[0] eq "--verbose");
my $file_name = "";
my $num = 0;
......@@ -38,7 +40,7 @@ while ($file_name = next_file($file_name)) {
last;
}
print "Checking $file_name ...\n";
print "Checking $file_name ...\n" if $verbose;
my @e = get_endings($file_name);
my $f = $e[0];
......
......@@ -18,12 +18,14 @@ EOHelp
}
my $verbose = ($ARGV[0] eq "--verbose");
my $file_name = "";
while ($file_name = next_file($file_name)) {
print "Checking $file_name ...\n";
print "Checking $file_name ...\n" if $verbose;
my @e = get_endings($file_name);
my @f = get_forms($file_name);
......
......@@ -32,13 +32,15 @@ EOHelp
}
my $verbose = ($ARGV[0] eq "--verbose");
my $file_name = "";
my $num = 0;
while ($file_name = next_file($file_name)) {
print "Checking $file_name ...\n";
print "Checking $file_name ...\n" if $verbose;
if ($file_name =~ /bg\d\d\d[.]dat$/) {
$num = substr($file_name, -7, 3);
......@@ -105,8 +107,8 @@ while ($file_name = next_file($file_name)) {
if (($c1 =~ /[-]{$l1}/) && ($c2 =~ /[-]{$l2}/)) {
$result = 3;
}
} elsif (($num == 145) && ($c =~ /[-]{$l}/)) {
# Some cases in 145 do not have ?
} elsif ((($num == 145) || ($num == 18)) && ($c =~ /[-]{$l}/)) {
# Some cases in 145 and 18a do not have ?
$result = 3;
}
}
......@@ -131,8 +133,17 @@ while ($file_name = next_file($file_name)) {
my $result = 0;
if ($c eq "-") {
$result = 4;
} elsif ($c =~ /[-]{$l}/) {
$result = 2;
} else {
if ($num <= 193) {
if ($c =~ /[- ]{$l}/) {
$result = 1;
}
} else {
$l--;
if ($c =~ /[-]{1}[- ]{$l}/) {
$result = 2;
}
}
}
if (($result == 0) || ($l == 0)) {
print " $file_name <$c>.\n"
......
......@@ -20,12 +20,14 @@ EOHelp
}
my $verbose = ($ARGV[0] eq "--verbose");
my $file_name = "";
while ($file_name = next_file($file_name)) {
print "Checking $file_name ...\n";
print "Checking $file_name ...\n" if $verbose;
my @t = get_tests($file_name);
......
......@@ -22,13 +22,14 @@ EOHelp
exit;
}
my $verbose = ($ARGV[0] eq "--verbose");
my $file_name = "";
while ($file_name = next_file($file_name)) {
print "Checking $file_name ...\n";
print "Checking $file_name ...\n" if $verbose;
my $f = get_filter($file_name);
my @e = get_endings($file_name);
......
#!/bin/bash
./build_root_words.sh
./build_derivative_words.sh
perl build_types.pl > types.dat
perl build_parts.pl > parts.dat