<commit_before>iLanguage
============

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-url]][daviddm-image]

A semi-unsupervised language independent morphological analyzer useful for stemming unknown language text, or getting a rough estimate of possible parses for morphemes in a word. Uses compression, maximum entropy and fieldlinguistics.



## Install

```bash
$ npm install --save ilanguage
```


## Usage

```javascript
var iLanguage = require('ilanguage');
var lang = new iLanguage(); 
```
<commit_msg>changed the example back to the old way<commit_after>iLanguage
============

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-url]][daviddm-image]

A semi-unsupervised language independent morphological analyzer useful for stemming unknown language text, or getting a rough estimate of possible parses for morphemes in a word. Uses compression, maximum entropy and fieldlinguistics.



## Install

```bash
$ npm install --save ilanguage
```


## Usage

[More examples](https://github.com/iLanguage/iLanguage/tree/master/test)

```javascript
 var textToTest = {
      orthography: "this will not have any stop words or morphemes, vulgar words or unrepresentative words like banana",
      nonContentWordsArray: "not any",
      userSpecifiedNonContentWords: true,
      userRemovedWordsForThisDocumentArray: ['banana'],
      userRemovedWordsForAllDocumentsArray: ['vulgar'],
      // morphemes: /(^un|^pre|s$|ed$|ing$)/,
      morphemesArray: ["un-", " pre-", " -s", " -ed", " -ing"]
    };
    NonContentWords.processNonContentWords(textToTest);
    expect(NonContentWords.filterText(textToTest).filteredText)
    .toEqual('thi will  have  stop word or morpheme  word or representative word like ');
  
```

{'fraction_non_alphanumeric': 0.13503253796095444, 'fraction_numerical': 0.0, 'mean_word_length': 4.951612903225806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '548594', 'n_tokens_mistral': 585, 'n_tokens_neox': 539, 'n_words': 158}