@_grammar_ might correct your grammar on Twitter!
This is a parser that corrects some specific common grammar errors.
The code is licensed under a modified version of the AGPL. See LICENSE.txt and agpl-3.0.txt for more details.
package main
import (
"victorz.ca/grammar"
"fmt"
)
func runTest(s string) (undetected bool) {
r := grammar.MakeTweetReply(s, "@")
if r == "" {
r = "(No errors detected!)"
undetected = true
}
fmt.Println(r)
return
}
func main() {
for _, test := range [...]string{
"Nothing's wrong with this sentence.",
"But it's true that their is a problem with this sentence.",
} {
for i := 0; i < 20; i++ {
if runTest(test) {
break
}
}
}
}