Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be more careful about final LUs in analysis mode (#104) #105

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lttoolbox/fst_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,10 @@ FSTProcessor::analysis(FILE *input, FILE *output)
bool firstupper = false, uppercase = false;
map<int, set<int> >::iterator rcx_map_ptr;

while(wchar_t val = readAnalysis(input))
wchar_t val;
do
{
val = readAnalysis(input);
// test for final states
if(current_state.isFinal(all_finals))
{
Expand Down Expand Up @@ -1627,7 +1629,10 @@ FSTProcessor::analysis(FILE *input, FILE *output)

if(current_state.size() != 0)
{
alphabet.getSymbol(sf, val);
if(val)
{
alphabet.getSymbol(sf, val);
}
}
else
{
Expand All @@ -1651,7 +1656,10 @@ FSTProcessor::analysis(FILE *input, FILE *output)
{
fputwc_unlocked(L'\\', output);
}
fputwc_unlocked(val, output);
if(val)
{
fputwc_unlocked(val, output);
}
}
}
else if(last_postblank)
Expand Down Expand Up @@ -1780,6 +1788,7 @@ FSTProcessor::analysis(FILE *input, FILE *output)
last_preblank = false;
}
}
while(val);

// print remaining blanks
flushBlanks(output);
Expand Down