Refactor quote handling and add new rules for possessive quotes

This commit is contained in:
2026-01-03 15:14:31 +08:00
parent 792bbc80c6
commit 5ba00b7fc9
2 changed files with 45 additions and 10 deletions

View File

@@ -15,7 +15,8 @@ main = hspec $ do
applyRules myRules "你…好" `shouldBe` "你… 好"
applyRules myRules "你...好" `shouldBe` "你... 好"
applyRules myRules "你:0" `shouldBe` "0"
applyRules myRules "我说:\" 他说:\'你好\'\"" `shouldBe` "我说:\"他说:\'你好\'\""
it "adds spaces" $ do
applyRules myRules "\'你好\'" `shouldBe` "\'你好\'"
applyRules myRules "\'hello\'" `shouldBe` "\'hello\'"
it "fixes quotes" $ do
applyRules myRules "我说:\" 他说:'你好'\"" `shouldBe` "我说:\"他说:' 你好 '\""
-- applyRules myRules "'你好'" `shouldBe` "' 你好'" -- strange behavior
applyRules myRules "'hello'" `shouldBe` "'hello'"
applyRules myRules "我 's " `shouldBe` "我's "