1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Guessing the language from a block of text

Discussion in 'PHP' started by Dejavu, Apr 21, 2005.

  1. #1
    Do anybody know of a way to figure out what language a specific webpage/text block is in php?
     
    Dejavu, Apr 21, 2005 IP
  2. jocs

    jocs Peon

    Messages:
    103
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Its in order to figure the best way to do it.
     
    jocs, May 1, 2005 IP
  3. jocs

    jocs Peon

    Messages:
    103
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    here: http://www.ranks.nl/stopwords/ you have some of the most common words (Stopwords) for English, Catalan, Czech, Danish, Dutch, French, German, Hungarian, Italian, Norwegian, Polish, Portugese, Spanish, Turkish.

    If you search for stopwords in your block of text, and count how many of each words of each language you find, the language with most number of stopwords in your block of text will be the language of the text.
     
    jocs, May 1, 2005 IP
  4. Dejavu

    Dejavu Peon

    Messages:
    916
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks!
    I didnt think anyone was actually gonna respond to this thread.
     
    Dejavu, May 1, 2005 IP
  5. jocs

    jocs Peon

    Messages:
    103
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Have you tried to determine the language of a block of text in that way?
     
    jocs, May 14, 2005 IP
  6. Dejavu

    Dejavu Peon

    Messages:
    916
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not yet, but I plan to. I want to use it on my lyrics site to allow translations of lyrics in different languages.
     
    Dejavu, May 16, 2005 IP