summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-23 19:12:36 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-23 19:12:36 +0800
commit4f45286b35c94f1bd7e2048a543787f5e9f103bc (patch)
treeb501aeb6856733b961b2ff74bbec51225235486a /lib
parent32f09fe1f453cd3e0ab96386f331dab381ff1435 (diff)
downloadtrainer-4f45286b35c94f1bd7e2048a543787f5e9f103bc.tar.gz
trainer-4f45286b35c94f1bd7e2048a543787f5e9f103bc.tar.xz
trainer-4f45286b35c94f1bd7e2048a543787f5e9f103bc.zip
re-factor myconfig.py
Diffstat (limited to 'lib')
-rw-r--r--lib/myconfig.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/lib/myconfig.py b/lib/myconfig.py
index 888f2ca..7a81b60 100644
--- a/lib/myconfig.py
+++ b/lib/myconfig.py
@@ -38,10 +38,9 @@ class MyConfig:
def getEvalsDir(self):
return self.m_evals_dir
- m_estimates_model = m_tools_dir + '/data/estimates.db'
-
def getEstimatesModel(self):
- return self.m_estimates_model
+ estimates_model = m_tools_dir + '/data/estimates.db'
+ return estimates_model
def getEstimateIndex(self):
return 'estimate.index'
@@ -49,29 +48,26 @@ class MyConfig:
def getSortedEstimateIndex(self):
return 'estimate.sorted.index'
- m_evals_text = m_tools_dir + '/data/evals.text'
-
def getEvalsText(self):
- return self.m_evals_text
-
- #about 1,200 Chinese characters
- m_minimum_chinese_characters = 1200
- m_minimum_file_size = m_minimum_chinese_characters * 3 + \
- m_minimum_chinese_characters / 2
+ evals_text = m_tools_dir + '/data/evals.text'
+ return evals_text
def getMinimumFileSize(self):
- return self.m_minimum_file_size
+ #about 1,200 Chinese characters
+ minimum_chinese_characters = 1200
+ minimum_file_size = minimum_chinese_characters * 3 + \
+ minimum_chinese_characters / 2
- m_candidate_model_size = 11.9 * 1024 * 1024
+ return minimum_file_size
#the trained corpus size of model candidates
def getCandidateModelSize(self):
- return self.m_candidate_model_size
-
- m_candidate_model_name = "model-candidates-{0}.db"
+ candidate_model_size = 11.9 * 1024 * 1024
+ return candidate_model_size
def getCandidateModelName(self, index):
- return self.m_candidate_model_name.format(index)
+ candidate_model_name = "model-candidates-{0}.db"
+ return candidate_model_name.format(index)
def getMaximumOccursAllowed(self):
return 20