Changeset ac7d970 for app/src/lib
- 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/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.