Last change
on this file since f4bf33e was
5f4d9c3,
checked in by Maciej Prill <mprill@…>, 13 years ago
|
Rewritten the build system, added lem UTF-8 version.
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | |
---|
2 | #include "../lib/tfti.h" |
---|
3 | #include "../lib/word.h" |
---|
4 | |
---|
5 | #include <sys/timeb.h> |
---|
6 | |
---|
7 | /************************************************************** |
---|
8 | * Zawiera definicje klasy Guess. * |
---|
9 | * * |
---|
10 | * Klasa ta pozwala na okreslenie opisu slowa nie * |
---|
11 | * znajdujacego sie w slowniku wraz z prawdopodobienstwem * |
---|
12 | * jego wystapienia. * |
---|
13 | *************************************************************/ |
---|
14 | |
---|
15 | class Guess { |
---|
16 | |
---|
17 | public: |
---|
18 | |
---|
19 | // nazawa pliku slownika w parametrze |
---|
20 | Guess(const char* suf_file); |
---|
21 | |
---|
22 | // zwraca tablice opisow slowa wraz z prawdopodobienstwem ich wystapienia |
---|
23 | int ana(const char* word, Words& result); |
---|
24 | |
---|
25 | long time_overall; |
---|
26 | |
---|
27 | private: |
---|
28 | |
---|
29 | // sufiksy |
---|
30 | TFTiv<char, char> _suf; |
---|
31 | |
---|
32 | // prefiksy |
---|
33 | TFTiv<char, char> _pref; |
---|
34 | |
---|
35 | //odwraca ciag znakow |
---|
36 | int reverse(const char* src, char* dest) { |
---|
37 | |
---|
38 | // assert((src != NULL) && (dest != NULL)); |
---|
39 | |
---|
40 | const char* c = src; |
---|
41 | |
---|
42 | int len = strlen(src); |
---|
43 | |
---|
44 | for (int i=1; i<=len; ++i) { |
---|
45 | dest[i-1] = src[len-i]; |
---|
46 | } |
---|
47 | |
---|
48 | dest[len] = '\0'; |
---|
49 | |
---|
50 | return 0; |
---|
51 | } |
---|
52 | |
---|
53 | //dodaje nowy element do tablicy WordsProb |
---|
54 | int add_word_prob(Words& tab, const char* word, const char* path, unsigned len, int source); |
---|
55 | |
---|
56 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.