Changeset ac7d970
- Timestamp:
- 04/08/08 13:53:51 (17 years ago)
- Branches:
- master, help
- Children:
- 0214596
- Parents:
- 317d53b
- git-author:
- pawelk <pawelk@…> (04/08/08 13:53:51)
- git-committer:
- pawelk <pawelk@…> (04/08/08 13:53:51)
- Location:
- app
- Files:
-
- 10 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Makefile
r20b4e44 rac7d970 28 28 29 29 # list of components to be included in the distribution 30 COMPONENTS = compiledic cor fla gph grp kon ko t lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla30 COMPONENTS = compiledic cor fla gph grp kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla 31 31 # gue nie dziala! 32 32 -
app/TODO
r2fe08ac rac7d970 1 1 BARDZO WAZNE: 2 2 3 * lem nie obsluguje dlugich wyrazow [TO]4 3 * gue SIE NIE KOMPILUJE !!! 5 * poprawic cora [PK]6 4 7 5 WAZNE: -
app/dist/common/utt_make_config.pl
ra4d0da5 rac7d970 15 15 16 16 conf_cor(catfile($usr_home, 'cor.conf'), $sys_home); 17 conf_kor(catfile($usr_home, 'kor.conf'), $sys_home); 17 18 conf_compiledic(catfile($usr_home, 'compiledic.conf'), $sys_home); 18 19 conf_grp(catfile($usr_home, 'grp.conf'), $sys_home); … … 99 100 } 100 101 102 sub conf_kor() { 103 my $kor_file = shift; 104 my $utthome = shift; 105 open(FILE, ">$kor_file"); 106 107 print FILE makeConfigHeader(); 108 print FILE "dictionary-home=", abs_path("$utthome/share/utt"), "\n"; 109 print FILE "weights=", abs_path("$utthome/lib/utt/weights.cor"), "\n"; 110 print FILE "threshold=1.0\n"; 111 112 close FILE; 113 } 114 101 115 sub conf_grp() { 102 116 my $grp_file = shift; -
app/dist/struktura.txt
re1b08a2 rac7d970 44 44 /usr/local/lib/utt/ser.l.template 45 45 /usr/local/lib/utt/terms.m4 46 /usr/local/lib/utt/weights.cor 46 47 47 48 /usr/local/share/doc/utt/FAQ -
app/src/common/common.h
r25ae32e rac7d970 4 4 #include <stdio.h> 5 5 #include <ctype.h> 6 #include <string.h> 7 #include <stdlib.h> 6 8 7 9 #include "../lib/const.h" -
app/src/lib/word.cc
r25ae32e rac7d970 23 23 24 24 //--------------------------------------------------------------------------- 25 intWord::cmp_w(Word a, Word b) {25 bool Word::cmp_w(Word a, Word b) { 26 26 return (a.w_suf() > b.w_suf()); 27 27 } … … 124 124 tab.resize(tab.size()*2); 125 125 126 tab[cnt].form(fo); 127 tab[cnt].w_suf(0.0); 126 127 Word o; 128 o.form(fo); 129 o.w_suf(0.0); 130 tab.push_back(o); 131 // tab[cnt].form(fo); 132 // tab[cnt].w_suf(0.0); 133 128 134 129 135 // if(cnt<MAX-1) { … … 132 138 tab[cnt]->w_suf(0.0); 133 139 tab[cnt]->w_pref(0.0);*/ 140 return cnt++; 141 // } 142 //return -1; 143 } 144 145 //--------------------------------------------------------------------------- 146 147 //TYMCZASOWO TAK(DLA CORA) 148 int Words::add(const char* fo, float weight) 149 { 150 int i = find(fo); 151 if(i!=-1) { 152 return i; 153 } 154 155 if (cnt>=tab.capacity()-1) 156 tab.resize(tab.size()*2); 157 158 Word o; 159 o.form(fo); 160 o.w_suf(weight); 161 tab.push_back(o); 162 // tab[cnt].form(fo); 163 // tab[cnt].w_suf(weight); 164 134 165 return cnt++; 135 166 // } -
app/src/lib/word.h
r25ae32e rac7d970 12 12 13 13 using namespace std; 14 15 14 16 15 17 class Word … … 37 39 // float _w_pref; 38 40 public: 39 static intcmp_w(Word a, Word b);41 static bool cmp_w(Word a, Word b); 40 42 41 43 Word() : _len_suf(-1) { *f='\0'; returned=0; }; … … 76 78 77 79 }; 80 78 81 79 82 inline Word::Word(const Word& word) … … 119 122 void clear() { cnt=0; tab.clear(); } 120 123 int add(const char* fo); 124 int add(const char* fo, float weight); 121 125 int add(const char* fo, const char* des); 122 126 -
app/src/tok/tok
r20b4e44 rac7d970 11 11 use File::HomeDir; 12 12 13 my $max_form_length = 50; 14 13 15 my $interactive=0; 14 16 my $help; … … 21 23 my $file; 22 24 foreach $file ($systemconfigfile, $userconfigfile){ 23 if(open(CONFIG, $ configfile1)){25 if(open(CONFIG, $file)){ 24 26 while (<CONFIG>) { 25 27 chomp; … … 75 77 # | [^[:print:]] (?{seg("B",$&)}) 76 78 79 sub min { 80 my ($val1, $val2) = @_; 81 if($val1 < $val2) { 82 return $val1; 83 } 84 else { 85 return $val2; 86 } 87 } 88 77 89 78 90 sub seg 79 91 { 80 92 my ($tag,$match) = @_; 81 my $len=length $match; 82 printf "%04d %02d %s ", $offset, $len, $tag; 93 my $length = length $match; 94 my $idx = 0; 95 while($idx < $length) { 96 my $l = min $max_form_length, $length - $idx; 97 my $m = substr $match, $idx, $l; 98 99 printf "%04d %02d %s ", $offset + $idx, $l, $tag; 83 100 if($tag eq 'S') 84 101 { 85 for(my $i=0; $i<$l en; ++$i)102 for(my $i=0; $i<$l; ++$i) 86 103 { 87 my $c = substr $m atch, $i, 1;104 my $c = substr $m, $i, 1; 88 105 print '_' if $c eq ' '; 89 106 print '\n' if $c eq "\n"; … … 95 112 elsif($tag eq 'B') 96 113 { 97 printf "\\x%02X", ord($m atch);114 printf "\\x%02X", ord($m); 98 115 } 99 116 else 100 117 { 101 print $m atch;118 print $m; 102 119 } 103 120 print "\n"; 104 $offset += $len; 105 } 121 $idx += $l; 122 } # while($idx < $length) 123 $offset += $length; 124 } #sub seg 125
Note: See TracChangeset
for help on using the changeset viewer.