Skip to content

Instantly share code, notes, and snippets.

@ozgurshn
Last active March 10, 2019 20:16
Show Gist options
  • Save ozgurshn/da81c510fafd53b63483dd0c2064572e to your computer and use it in GitHub Desktop.
Save ozgurshn/da81c510fafd53b63483dd0c2064572e to your computer and use it in GitHub Desktop.
NLLanguageRecognizer
import NaturalLanguage
let recognizer = NLLanguageRecognizer()
recognizer.processString("oduncu")
let lang = recognizer.dominantLanguage
let hypotheses = recognizer.languageHypotheses(withMaximum:2)
//convenience method: NLLanguageRecognizer.dominantLanguage(for: "oduncu")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment