Skip to content

cycloped-io/wiktionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word conversion rules from Wiktionary

The aim of the project is providing ruls for converting English words and basic informations about the words morphology. The project is based on the English Wiktionary thus the descriptions are pretty accurate and include most of the exceptions (e.g. ox -> oxen).

Basic usage

Installation:

$ gem install wiktionary

So far only nouns are supported.

require 'wiktionary/noun'

nouns = Wiktionary::Noun.new
nouns.singularize("dogs") #=> ["dog"]
nouns.singularize("oxen") #=> ["ox"]
nouns.singularize("feet") #=> ["foot"]

nouns.singular?("dog")  #=> true
nouns.singular?("dogs") #=> false


nouns.plural?("dog")  #=> false
nouns.plural?("dogs") #=> true

The singularize method returns an array since there might be more than one base form of a given plural word.

Data

The data directory - contains lists and mappings of noun forms (plural, singular, countable, etc.). They are used to identify plural forms and transform plural to singular. Generated from Wiktionary dump using https://github.com/djstrong/nouns-with-plurals.

The following files are available:

The following files contain two columns (singular and plural form):

  • noun.csv
  • noun_countable_and_uncountable.csv
  • noun_usually_uncountable.csv

Credits

Krzysztof Wróbel (djstrong) Aleksander Smywiński-Pohl (apohllo)

About

Word conversion rules extracted from the English Wiktionary

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages