mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-13 20:12:24 +00:00
small fixes
This commit is contained in:
parent
1746514348
commit
b64fb60a0d
@ -179,7 +179,7 @@ def _process_grams(
|
|||||||
def process(args):
|
def process(args):
|
||||||
b = kenlm.LanguageModel(args.b)
|
b = kenlm.LanguageModel(args.b)
|
||||||
logging.info(f"Order of {args.b}: {b.order}")
|
logging.info(f"Order of {args.b}: {b.order}")
|
||||||
pattern = re.compile(r"\\(\d+)-grams:")
|
pattern = re.compile(r"\\(\d+)-grams:\n")
|
||||||
out = open(args.out, "w", encoding="utf-8")
|
out = open(args.out, "w", encoding="utf-8")
|
||||||
|
|
||||||
a_scale = args.a_scale
|
a_scale = args.a_scale
|
||||||
@ -188,7 +188,7 @@ def process(args):
|
|||||||
with open(args.a, encoding="utf-8") as a:
|
with open(args.a, encoding="utf-8") as a:
|
||||||
for line in a:
|
for line in a:
|
||||||
print(line, end="", file=out)
|
print(line, end="", file=out)
|
||||||
m = pattern.search(line)
|
m = pattern.match(line)
|
||||||
if m:
|
if m:
|
||||||
order = int(m.group(1))
|
order = int(m.group(1))
|
||||||
_process_grams(
|
_process_grams(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user