diff options
author | Patrick Simianer <p@simianer.de> | 2014-10-13 19:03:48 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-10-13 19:03:48 +0100 |
commit | cb9fb7088dde35881516c088db402abe747d49fa (patch) | |
tree | a91e4935a7941f1b261f76d88ab41fa3078a1891 /python/cdec/_cdec.pyx | |
parent | 0a00e57e921c8eca8e02364db7d2e6607bfdcebc (diff) | |
parent | b1ed81ef3216b212295afa76c5d20a56fb647204 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python/cdec/_cdec.pyx')
-rw-r--r-- | python/cdec/_cdec.pyx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/cdec/_cdec.pyx b/python/cdec/_cdec.pyx index 2e4265d4..2509c6cd 100644 --- a/python/cdec/_cdec.pyx +++ b/python/cdec/_cdec.pyx @@ -85,13 +85,13 @@ cdef class Decoder: cdef variables_map* conf = &self.dec.GetConf() return str(conf[0]['formalism'].as_str().c_str()) - def read_weights(self, weights): + def read_weights(self, weights, scaling = 1.0): """decoder.read_weights(filename): Read decoder weights from a file.""" with open(weights) as fp: for line in fp: if line.strip().startswith('#'): continue fname, value = line.split() - self.weights[fname.strip()] = float(value) + self.weights[fname.strip()] = float(value) * scaling def translate(self, sentence, grammar=None): """decoder.translate(sentence, grammar=None) -> Hypergraph |