-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
I have the following text:
Ein neues Korpus mit Stichtag Juli 2012 wurde Ende des Jahres zugänglich gemacht.
and the following program:
package main
import (
"fmt"
"github.com/pemistahl/lingua-go"
"os"
)
func main() {
detector := lingua.NewLanguageDetectorBuilder().
FromAllLanguages().
Build()
text, err := os.ReadFile(os.Args[1])
if err != nil {
panic(err)
}
stext := string(text)
for _, result := range detector.DetectMultipleLanguagesOf(stext) {
fmt.Printf("%s: '%s'\n", result.Language(), stext[result.StartIndex():result.EndIndex()])
}
}
The output is:
German: 'Ein neues Korpus mit '
Swahili: 'Stichtag Juli '
German: '2012 wurde Ende des Jahres zugänglich gemacht.
'
How to work around such problems?
Metadata
Metadata
Assignees
Labels
No labels