Project

wiktionary

0.0
No commit activity in last 3 years
No release in over 3 years
English words morphological description and basic conversion rules based on the English Wiktionary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 11.0.0, >= 10.4.0
< 4.0.0, >= 3.2.0

Runtime

 Project Readme

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)