amitdo / dawgdic

Automatically exported from code.google.com/p/dawgdic
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Completer segfaults with empty dawgs #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use DawgBuilder to create an empty DAWG;
2. create a Dictionary for this DAWG;
3. create a Guide for this Dictionary and DAWG;
4. create a Completer using this Dictionary and Guide;
5. try to use completer.Next() method

What is the expected output? What do you see instead?

Either "completer.Next()" should return "false" on first call or 
GuideBuilder.Build should return false for empty DAWGs.

Instead of this, completer.Next() segfaults because Completer.FindTerminal 
calls guide_->child(0) and guide_.units_ is empty.

What version of the product are you using? On what operating system?

I'm using latest dawgdic bundled with Python wrapper (0.4.4). Found this issue 
trying to debug why the wrapper segfaults with empty dawgs.

Original issue reported on code.google.com by kmik...@gmail.com on 30 Sep 2012 at 2:25

GoogleCodeExporter commented 8 years ago
Thanks for your kind report!

I've fixed this bug (r58).

Original comment by susumu.y...@gmail.com on 1 Oct 2012 at 12:56

GoogleCodeExporter commented 8 years ago
Thanks for a quick fix! 

Original comment by kmik...@gmail.com on 1 Oct 2012 at 4:19