Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Determining Language

Determining Language

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionlounge
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wendyw
    wrote on last edited by
    #1

    I am writing an application in C++ to monitor chat from multilingual chat rooms. I would like to be able to determine what language the chat is in, as in some rooms only certain languages are allowed. I was thinking of using the unicode ranges to determine whether the characters of the chat are in the allowed set - but this become difficult with the asian languages as the are over 200 different language sets defined. Does anyone know of an easier method of determining what language is being used?

    D 1 Reply Last reply
    0
    • W wendyw

      I am writing an application in C++ to monitor chat from multilingual chat rooms. I would like to be able to determine what language the chat is in, as in some rooms only certain languages are allowed. I was thinking of using the unicode ranges to determine whether the characters of the chat are in the allowed set - but this become difficult with the asian languages as the are over 200 different language sets defined. Does anyone know of an easier method of determining what language is being used?

      D Offline
      D Offline
      Dennis Gourjii
      wrote on last edited by
      #2

      Look up words in a tiny dictionary of commonly used language-specific words. Examples for English would be: I, you, he, she, it, a, the, have, has, am, are, is.... (you won't need more than a dozen or so per language) Making a mistake is of course possible, but if you scan input thoroughly enough chances are you'll determine the language accurately. Of course, the issue must have been looked into by many philologists. Try searching the web. Technically, if you wish to avoid this method all you can do is try checking character codes unless you want to mess with checking the current keyboard layout. I've never tried the latter but it looks like headache and guarantees absolutely nothing...

      W 1 Reply Last reply
      0
      • D Dennis Gourjii

        Look up words in a tiny dictionary of commonly used language-specific words. Examples for English would be: I, you, he, she, it, a, the, have, has, am, are, is.... (you won't need more than a dozen or so per language) Making a mistake is of course possible, but if you scan input thoroughly enough chances are you'll determine the language accurately. Of course, the issue must have been looked into by many philologists. Try searching the web. Technically, if you wish to avoid this method all you can do is try checking character codes unless you want to mess with checking the current keyboard layout. I've never tried the latter but it looks like headache and guarantees absolutely nothing...

        W Offline
        W Offline
        wendyw
        wrote on last edited by
        #3

        Thanks. I had thought of your first method, but I think certain languages use similar words so the accuracy wouldn't be that good especially for chat as maybe only one of the words I am searching for would be used per chat line. Haven't had much luck on the web either :(

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups