2

i'm new to c++ and need a way for detecting the language of the text. i searched for any plugin to do that and only found the chromum open source code.
https://code.google.com/p/cld2/
there is many pages talking about using it at python, java or stand alone but i cant find any tutorial about using it in a c++ code.
so i need a declaration for how to use it or any other good library for detecting the text language using c++.
the language text will be added by user and i want to detect if it is English , French or Arabic .. etc to apply nlp according to that.

Thanks,

amr
  • 49
  • 6
  • 3
    I don't understand what do you mean by *text*? Where is that text? How do you get it? Give an example of such text? Are you refering to the [code segment](https://en.wikipedia.org/wiki/Code_segment), also known as the *text segment*, of your executable? Please **edit your question to improve it** a lot, and give some context, motivations, and example.... Is your question related to [natural language processing](https://en.wikipedia.org/wiki/Natural_language_processing)? [N-grams](https://en.wikipedia.org/wiki/N-gram)? – Basile Starynkevitch Jul 01 '15 at 12:29
  • text will be entered by users and want to get the language if it is english , french or arabic etc – amr Jul 01 '15 at 12:35
  • 1
    **Edit your question**, don't add comments explaining it. – Basile Starynkevitch Jul 01 '15 at 12:37

1 Answers1

0

Although its not a library, one option you have is to simply use Google translates API to detect the language. This is done using REST. The obvious downside is that you need to be connected to the internet to make the call. The docs explain how you can do this here

Mo H.
  • 1,788
  • 1
  • 18
  • 28