1 // Grammar 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.
7 // See also the very similar grammar type in DCNgrammar.h
13 typedef QMap
<QChar
, float> SonorityMap
;
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
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
);
46 bool isInMap(QChar c
) const;
50 #endif // GRAMMARSYL_H