wolfgarbe / SymSpell

SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
https://seekstorm.com/blog/1000x-spelling-correction/
MIT License
3.12k stars 284 forks source link

NullReferenceException in CommitStaged #139

Open ccady opened 3 months ago

ccady commented 3 months ago

The following code demonstrates a NullReferenceException when invoking CommitStaged:

public void SymSpellTest()
{
    // Demonstrates a problem in SymSpell.
    var spell = new SymSpell();
    var stage = new SymSpell.SuggestionStage(10);
    spell.CreateDictionaryEntry("word", 10, stage);
    spell.CommitStaged(stage); // this causes a NullReferenceException
}

I have been having trouble figuring this out. I apologize for not debugging further.

wolfgarbe commented 3 months ago

Thank you for reporting the issue. I will look into this.