latitudegames / AIDungeon

Infinite adventures await!
http://www.aidungeon.io/
MIT License
3.18k stars 555 forks source link

Fix end punctuation from being chopped off. #237

Closed KevinMoonglow closed 4 years ago

KevinMoonglow commented 4 years ago

The cut_trailing_sentence function would cut off the ending punctuation, leaving generated text without an ending punctuation. This change should fix that.

It may also fix an occasional bug I've seen where the last letter of a word gets cut off, which may be caused by this method chopping off a character too much in certain situations.

Credit goes to Herohtar for posting a bug report identifying the problem and the section of code responsible.

๐ŸŽ‰ Issues resolved:

๐Ÿงช How to Test

Simply play the game. Responses from the AI previously didn't end with punctuation. After this fix, most responses should end in punctuation.