CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / DCNgrammarsyl.h
blob359184d230031ebcca2d3aa8adf3975af99f9c60
1 // Grammar type for syllable discovery with Dynamic Computational Networks
2 // Copyright © 2009 The University of Chicago
3 #ifndef GRAMMARSYL_H
4 #define GRAMMARSYL_H
6 // See the corpussyl documentation in DCNcorpussyl.h for an overview.
7 // See also the very similar grammar type in DCNgrammar.h
9 #include <qlabel.h>
10 #include <qmap.h>
11 #include <qstring.h>
13 typedef QMap<QChar, float> SonorityMap;
15 /**
16 * A grammar holds the DCN's parameters. It's like an array of six
17 * floats, but much smarter, because you can make deep copies and
18 * you can print it really easily. It's an easy way to think of
19 * what the internal grammar of a language-user might be in the
20 * DCN model.
22 class grammarsyl
25 private:
26 float alpha;
27 float beta;
28 SonorityMap map;
30 public:
31 grammarsyl();
32 grammarsyl(grammarsyl &theGrammar);
33 virtual ~grammarsyl();
35 void setValues(float alpha, float beta);
36 void setSonority(QChar c, float sonority);
37 void clearMap() { map.clear(); }
39 float getAlpha() const { return alpha; }
40 float getBeta() const { return beta; }
41 float getSonority(QChar c) const;
42 SonorityMap getMap() { return map; }
44 void print(QLabel *label);
45 QString print();
46 bool isInMap(QChar c) const;
50 #endif // GRAMMARSYL_H