Skip to content

Commit c7ae58a

Browse files
syntacticsyntactic
authored andcommitted
I fixed an issue in the Probabilistic Generator where the optional elements were adding additional spaces in cases where the inside of the optional element was excluded
1 parent 4f85d8f commit c7ae58a

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

JSGFGrammar.pyc

-6.95 KB
Binary file not shown.

JSGFParser.pyc

-7.51 KB
Binary file not shown.

ProbabilisticGenerator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def processSequence(seq):
9090
"""
9191
componentSets = []
9292
for component in seq:
93-
componentSets.append(processRHS(component).strip())
93+
expandedComponent = processRHS(component).strip()
94+
if len(expandedComponent) > 0:
95+
componentSets.append(expandedComponent)
9496
return ' '.join(componentSets)
9597

9698

0 commit comments

Comments
 (0)