GithubHelp home page GithubHelp logo

isabella232 / gibberish-detector-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paypal/gibberish-detector-java

0.0 0.0 0.0 2.29 MB

A small program to detect gibberish using a Markov Chain

License: MIT License

Java 100.00%

gibberish-detector-java's Introduction

Gibberish-Detector

Based on Python gibberish detector written by Rob Renaud. Ported into Java by Shir Fiszman.

You can find the original here: https://github.com/rrenaud/Gibberish-Detector

This gibberish detector is not limmited to a certain language, and can be trained on files by the user's choice.

How to use this library?

Use GibberishDetectorFactory in order to create a new instance of the gibberish detector. You should supply it the following inputs:

  • A big text file in the language of your choice for training.
  • A small text file with correct sentences.
  • A small text file with gibberish sentences.
  • A string containing the alphaBet of that language plus a space character. You can pass the files' data as lists of string, java file objects, paths of the files, or the names of local files. The factory instantiates a new GibberishDetector object that is trained by this input. Use the 'isGibberish' method in order to determine if a sentence is gibberish or not.

If you wish to select your own heuristic for setting the thrshold to classify sentences, you can override the method 'getThreshold' and implement it yourself. The factory can create instances of detectors that extend GibberishDetector.

Content

java files:

  • GibberishDetector - implements the gibberish detector algorythm used in the python open source gibberish detector.
  • GibberishDetectorExtended - an example of a detector the extends GibberishDetector and overrides the 'isGibberish' method.
  • GibberishDetectorFactory - the factory for creating an instance of a gibberish detector by the user's input.

text files:

  • bigEnglish.txt, goodEnglish.txt, badEnglish.txt - text files used as inputs in the test for english gibberish detector. same files used in the python open source gibberish detector.
  • bigHebrew.txt, goodHebrew.txt, badHebrew.txt - text files used as inputs in the test for hebrew gibberish detector.

tests:

  • EnglishGibbeirishDetectorTest - test for english gibberish detector. Demonstrates the usage of the factory with the GibberishDetectorExtended.
  • HebrewGibberishDetectorTest - test for hebrew gibberish detector. Demonstrates the usage of the factory on a language different than english.

License

Gibberish-Detector-Java is available under the MIT License. See LICENSE.txt.

gibberish-detector-java's People

Contributors

duaneobrien avatar eyala 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.