Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Text Mining with R

You're reading from  Mastering Text Mining with R

Product type Book
Published in Dec 2016
Publisher Packt
ISBN-13 9781783551811
Pages 258 pages
Edition 1st Edition
Languages
Concepts
Author (1):
KUMAR ASHISH KUMAR ASHISH
Profile icon KUMAR ASHISH

Language detection


TextCat is a text classification utility. The primary usage of TextCat is language identification. textcat package in R provides wrapper function for n-gram based text categorization and the language detection. It can detect up to 75 languages:

Library(textcat)
>my.profiles <- TC_byte_profiles[names(TC_byte_profiles)]
>my.profiles

A textcat profile db of length 75.

> my.text <- c("This book is in English language",
 "Das ist ein deutscher Satz.",
 "Il s'agit d'une phrase française.",
 "Esta es una frase en espa~nol.")
 textcat(my.text, p = my.profiles)
> textcat(my.text, p = my.profiles)

[1] "english" "german"  "french"  "spanish"
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}