@_grammar_ might correct your grammar on Twitter!
Go
Switch branches/tags
Nothing to show
Clone or download

README.md

grammar

Build Status Coverage Status codecov GoCover Go Report Card GoDoc

@_grammar_ might correct your grammar on Twitter!

This is a parser that corrects some specific common grammar errors.

License

The code is licensed under a modified version of the AGPL. See LICENSE.txt and agpl-3.0.txt for more details.

Example

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
			}
		}
	}
}