Skip to content

Commit

Permalink
address requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanakram3 committed Mar 4, 2024
1 parent b2a3c47 commit d0328f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ function cleanString(input: string): string {
export function predictLanguage(text: string): { lang: string; accuracy: number } | undefined {
const cleanedText = cleanString(text)

// console.log(`Cleaned text: ${cleanedText}`)
// Get the most accurate language prediction
return detectAll(cleanedText).length ? detectAll(cleanedText)[0] : undefined
return detectAll(cleanedText)?.[0]
}

export function predictVideoLanguage({
Expand Down

0 comments on commit d0328f1

Please sign in to comment.