Sign in to follow this  
Followers 0
Alexxander

Script that detect if the language is English or not -need help-

6 posts in this topic

Hi all

i want to make a auto it script that detect a language of a place on the screen, (maybe i make it copy a part of the text and user google translate to detect language ?)

i want it to detect one language (English)

i don't want the characters i only want it to detect if the language is English or not

i an new to Autoit and my knowledge is so limited can any one put me in the direct way ?


Share this post


Link to post
Share on other sites



What do you mean by "of a place on the screen"?

Can you post a screenshot?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What do you mean by "of a place on the screen"?

Can you post a screenshot?

when the user select the place that he want to type in  ex: (input box in a browser) the script scan the words that is up the input box then detect if it is English or not 

Edited by alexander95

Share this post


Link to post
Share on other sites

Search Google for something like this "determine language of text visual basic". If you find  a solution this shouldn't be too hard to translate to AutoIt.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Just out of curiosity, I looked and the Google Translate API is not free. Assuming you want to do this for free, here's my suggestion...

Perhaps you can create an array of the words in your block of text and check them against a list of the 100 most common English words (lots of websites list them). From that, you can calculate a percentage of probability that the language is English. The larger section of text you use, the more accurate your results would be. Also, you can use website domain filters to help figure it out. Example: websites that end in foreign country extensions are probably less likely to be in English. .de = German, .it = Italian, .hk = Hong Kong, etc.


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites

A few ideas I have seen on the net:

  • Each language has a few words that are extremely common, such as "the", "a", "an", "of", "for" in English. You could look for the 5 or 10 most common words.
    A good place to start is https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists
  • Have a look at the characters used: umlauts or the ss/beta character appear in German and acute or grave accents in French.
  • This looks somehow interesting too

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0