<commit_before>pluralizer.rb
=============

Artificial intelligence to turn singular nouns into their respective plural forms

To run from commandline
```sh
[maxwell@Orngcrsh:~/github/Pluralizer on master]
% ruby train.rb
```
```ruby
beer
Guess for Last_4_Letters_Heuristic:
===================================================
No matches found for beer
===================================================
Guess for Last_3_Letters_Heuristic:
===================================================
beer: beer
===================================================
Guess for Last_2_Letters_Heuristic:
===================================================
beer: beer
===================================================
```

Or file
```sh
[maxwell@Orngcrsh:~/github/Pluralizer on master]
% ruby train.rb
```
```ruby
Guess for Last_4_Letters_Heuristic:
===================================================
No matches found for class
fish: fish
No matches found for tomato
===================================================
Guess for Last_3_Letters_Heuristic:
===================================================
No matches found for class
fish: fishes
tomato: tomatoes
===================================================
Guess for Last_2_Letters_Heuristic:
===================================================
class: classes
fish: fishes
tomato: tomatoes
===================================================
```


##Training Data##
Looking for ANY sort of dataset on singular / plural words.  I can't seem
to find a good set unless I were to write a crawler.


##Development##

To write a heurstic, follow the code in heurstic.rb and implement
the train and guess functions.  In train.rb, be sure to add the heuristic
to the trainer class.<commit_msg>fixes<commit_after>pluralizer.rb
=============

Artificial intelligence to turn singular nouns into their respective plural forms

To run from commandline
```sh
[user@host:~/github/Pluralizer on master]
% ruby train.rb
```
```
beer
Guess for Last_4_Letters_Heuristic:
===================================================
No matches found for beer
===================================================
Guess for Last_3_Letters_Heuristic:
===================================================
beer: beer
===================================================
Guess for Last_2_Letters_Heuristic:
===================================================
beer: beer
===================================================
```

Or file
```sh
[user@host:~/github/Pluralizer on master]
% ruby train.rb filename
```
```
Guess for Last_4_Letters_Heuristic:
===================================================
No matches found for class
fish: fish
No matches found for tomato
===================================================
Guess for Last_3_Letters_Heuristic:
===================================================
No matches found for class
fish: fishes
tomato: tomatoes
===================================================
Guess for Last_2_Letters_Heuristic:
===================================================
class: classes
fish: fishes
tomato: tomatoes
===================================================
```

Could also pipe to or direct to (just uses ARGF)

##Training Data##
Looking for ANY sort of dataset on singular / plural words.  I can't seem
to find a good set unless I were to write a crawler.


##Development##

To write a heurstic, follow the code in heurstic.rb and implement
the train and guess functions.  In train.rb, be sure to add the heuristic
to the trainer class.
{'fraction_non_alphanumeric': 0.40274599542334094, 'fraction_numerical': 0.003432494279176201, 'mean_word_length': 8.106770833333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1386685', 'n_tokens_mistral': 892, 'n_tokens_neox': 772, 'n_words': 294}