Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import lande from 'lande'
2
3import {code3ToCode2Strict} from '#/locale/helpers'
4
5// TODO: Replace with expo-guess-language
6export function guessLanguage(text: string): string | null {
7 const results = lande(text)
8 // only return high-confidence results
9 if (results[0] && results[0][1] > 0.97) {
10 return code3ToCode2Strict(results[0][0]) ?? null
11 }
12 return null
13}