1 // Driver state type for syllable discovery with Dynamic Computational Networks
2 // Copyright © 2009 The University of Chicago
6 // See the corpussyl documentation in DCNcorpussyl.h for an overview.
9 #include "DCNgrammarsyl.h"
10 #include "DCNnetworksyl.h"
11 #include "DCNcorpussyl.h"
13 namespace linguistica
{ namespace ui
{ class status_user_agent
; } }
16 * The learning class uses a simplified version of Gary Larson's
17 * simulated annealing process to find an appropriate grammar
18 * given a corpus of various words with stress. The name is kind
19 * of weird -- it's easiest to think of an instance as a learning
20 * machine. It takes a corpus (an array of QStrings) and returns
21 * a possible grammar. It's also not very well implemented --
22 * nearly everything is public.
24 * The most interesting function is
25 * runHelper(), which is the essence of the learning algorithm.
26 * It is a first attempt at the learning algorithm, so at the
27 * moment it's kind of crappy. Luckily, the GUI supports
28 * inputting different values for the learning algorithm.
34 unsigned int numberOfWords
;
38 grammarsyl possibleGrammar
;
39 networksyl possibleNet
;
43 float increaseWhenWrong
;
44 float decreaseWhenRight
;
46 unsigned int cutoffFromUser
;
52 virtual ~learningsyl();
54 void run(linguistica::ui::status_user_agent
& status_display
);
55 bool isSuccessful() { return successful
; }
56 void setCorpus(corpussyl corpus
);
57 void print(class QLabel
* label
) { net
.print(label
); }
58 grammarsyl
* returnGrammar() { return rGrammar
; }
61 void runHelper(std::ostream
& logstream
,
62 linguistica::ui::status_user_agent
& status_display
);
65 #endif // LEARNINGSYL_H