Jump to content

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


Recommended Posts

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 ?

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...