1 // Driver for stress discovery with Dynamic Computational Networks
2 // Copyright © 2009 The University of Chicago
6 // See http://linguistica.uchicago.edu/dcnstress.htm for history and
9 #include "DCNgrammar.h"
11 namespace linguistica
{ namespace ui
{ class status_user_agent
; } }
12 typedef class QString
* corpusType
;
15 * The learning class uses a simplified version of Gary Larson's
16 * simulated annealing process to find an appropriate grammar
17 * given a corpus of various words with stress. The name is kind
18 * of weird -- it's easiest to think of an instance as a learning
19 * machine. It takes a corpus (an array of QStrings) and returns
20 * a possible grammar. It's also not very well implemented --
21 * nearly everything is public.
23 * The most interesting function is
24 * runHelper(), which is the essence of the learning algorithm.
25 * It is a first attempt at the learning algorithm, so at the
26 * moment it's kind of crappy. Luckily, the GUI supports
27 * inputting different values for the learning algorithm.
35 void run(linguistica::ui::status_user_agent
& status_display
);
36 bool isSuccessful() { return successful
; }
37 void setCorpus(corpusType corpus
, int numberOfWords
);
38 grammar
* returnGrammar();
41 float increaseWhenWrong
;
42 float decreaseWhenRight
;
44 unsigned int cutoffFromUser
;
52 void runHelper(class Q3TextStream
& logstream
,
53 linguistica::ui::status_user_agent
& status_display
);
58 grammar possibleGrammar
;