CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / DCNgrammar.cpp
blob403ddb9aa09e772036ba4fd4872a68ce5448f0fc
1 // Implementation of grammar methods
2 // Copyright © 2009 The University of Chicago
3 #include "DCNgrammar.h"
5 #include <qlabel.h>
7 //////////////////////////////////////////////////////////////////////
8 // Construction/Destruction
9 //////////////////////////////////////////////////////////////////////
11 grammar::grammar(){}
13 grammar::~grammar(){}
15 grammar::grammar(grammar &theGrammar)
17 alpha = theGrammar.getAlpha();
18 beta = theGrammar.getBeta();
19 I = theGrammar.getI();
20 F = theGrammar.getF();
21 P = theGrammar.getP();
22 bias = theGrammar.getBias();
26 void grammar::setValues(float alpha, float beta, float I, float F, float P, float bias)
28 this->alpha = alpha;
29 this->beta = beta;
30 this->I = I;
31 this->F = F;
32 this->P = P;
33 this->bias = bias;
36 void grammar::print(QLabel *label)
38 QString totalString;
39 QString partialString;
41 partialString.setNum(alpha);
42 totalString = "alpha:\t\t" + partialString + '\n';
43 partialString.setNum(beta);
44 totalString += "beta:\t\t" + partialString + '\n';
45 partialString.setNum(I);
46 totalString += "initial:\t\t" + partialString + '\n';
47 partialString.setNum(F);
48 totalString += "final:\t\t" + partialString + '\n';
49 partialString.setNum(P);
50 totalString += "penult:\t\t" + partialString + '\n';
51 partialString.setNum(bias);
52 totalString += "bias:\t\t" + partialString + '\n';
54 label->setText(totalString);