DajareGo provides checking a sentence if it is Dajare (Japanese pun).
First, import DajareGo to your project.
go get github.com/jugesuke/dajareGo
import "github.com/jugesuke/dajareGo"
Next, load dictionary of tokenizer.
if err := dajareGo.Init(); err != nil {
panic(err)
}
Next, use IsDajare
function.
result := dajareGo.IsDajare("アルミ缶の上にあるミカン")
To get the result if the sentence is Dajare, use result.IsDajare
.
result := dajareGo.IsDajare("アルミ缶の上にあるミカン")
if result.IsDajare {
fmt.Println("This is Dajare")
} else {
fmt.Println("This is not Dajare")
}
More information, please read Document.
In this Package, Dajare is defined the sentence contains pair(s) of words which has a similar reading but a different meaning.
The Gopher character is based on the Go mascot designed by Renée French.