Skip to content

Commit

Permalink
Fix(lua): fix potential dirty lattice
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeiwu authored Dec 24, 2024
1 parent 0295aaa commit a451482
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/kagiroi/kagiroi_viterbi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ end

function Lattice:analyze(input)
-- clear the lattice if it is a new input
if utf8.len(input) == 1 then
if utf8.len(input) == 1 or self.input == "" then
self:clear()
end
-- first we need to figure out the common prefix of input and self.input
Expand Down

0 comments on commit a451482

Please sign in to comment.