1 // Random string generator following a model of phonology
2 // Copyright © 2009 The University of Chicago
13 #include "generaldefinitions.h"
15 // This is a class that keeps track of unigram and bigram frequencies, and is
16 // able to produce strings on the basis of those distributions.
17 // The top level MonteCarlo keeps track of phone frequencies, and is
18 // capable of setting up one MonteCarlo for *each* of its phones, so
19 // that it can produce strings based on bigram frequencies.
20 // If we want that fancier kind, then the m_ModelType should be BIGRAM;
21 // otherwise, it should be UNIGRAM.
26 std::vector
<double> m_Values
;
28 bool m_ReadyForAction
;
30 Q3Dict
<MonteCarlo
> m_MyBigrams
;
31 QString m_MyFirstPhone
;
35 eModelType m_ModelType
;
39 MonteCarlo(int size
, QString MyFirstPhone
);
41 void Dump ( Q3TextStream
* );
42 void SetSize(int size
) { m_Size
= size
; };
43 int GetSize() { return m_Size
;};
44 Q3Dict
<MonteCarlo
>* GetMyBigrams() { return &m_MyBigrams
; }
45 void StockDictionary ( QString key
, double value
, int i
) { m_Keys
.append (key
);
46 m_Values
[i
] = value
; }
51 QString
ReturnCharacter ( );
52 QString
ReturnCharacter ( QString PrecedingChar
);
53 CParse
ReturnString ( CParse
& );
56 #endif // MONTECARLO_H