Skip to content

@_grammar_ might correct your grammar on Twitter!

License

Notifications You must be signed in to change notification settings

theonlypwner/grammar

Repository files navigation

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

About

@_grammar_ might correct your grammar on Twitter!

Resources

License

Stars

Watchers

Forks

Languages