Giter Site home page Giter Site logo

languagedetector's Introduction

Language Detector

Language Detector written in Java

The application is based on calculating and comparing language profiles of N-gram frequencies.

Reference: William B. Cavnar and John M. Trenkle. N-Gram-Based Text Categorization. In Proceedings of SDAIR-94, 3rd Annual Symposium on Document Analysis and Information Retrieval, 1994.

The Universal Declaration of Human Rights Database is used since i) it has been translated into over 460 different languages and dialects and ii) it’s free. In this application, only a subset of them are used to create language profiles: czc.txt - Czech (Cesky) dns.txt - Danish (Dansk) dut.txt - Dutch (Nederlands) eng.txt - English frn.txt - French (Français) ger.txt - German (Deutsch) grk.txt - Ellinika’ (Greek) hng.txt - Hungarian itn.txt - Italian jpn.txt - Japanese (Nihongo) lat.txt - Latvian lit.txt - Lithuanian (Lietuviskai) ltn.txt - Latin (Latina) lux.txt - Luxembourgish (Lëtzebuergeusch) mls.txt - Maltese por.txt - Portuguese rum.txt - Romanian (Româna) rus.txt - Russian (Russky) spn.txt - Español (Spanish) ukr.txt - Ukrainian (Ukrayins’ka) yps.txt - Yapese

Start

Starting the program

 >java -jar LanguageDetector.jar
 Do you wish to train your model first (y/n)?
 y
 Language profiles are saved
 Enter some large text (or exit): 
 what is the weather today
 Detected Language : eng

 Enter some text (or exit): 
 exit

The program first reads all texts in the trainingData folder. Then, it generates the language frequency profiles for each language in langModels folder and saves them. Next, text can be entered to identify the language.

Program Structure

  • langdetector source code
  • test source code of unit tests
  • trainingData training data
  • langModels language frequency profiles
  • doc generated java doc

languagedetector's People

Contributors

mqtuotuo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.