groovy-pluralize-en:0.2.1

Groovy extension module - helps pluralize words fairly accurately

Лицензия

Лицензия

Категории

Категории

Groovy Языки программирования
Группа

Группа

org.millarts
Идентификатор

Идентификатор

groovy-pluralize-en
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

groovy-pluralize-en:0.2.1
Groovy extension module - helps pluralize words fairly accurately
Ссылка на сайт

Ссылка на сайт

https://github.com/david-w-millar/groovy-pluralize-en/
Система контроля версий

Система контроля версий

https://github.com/david-w-millar/groovy-pluralize-en/

Скачать groovy-pluralize-en

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.millarts/groovy-pluralize-en/ -->
<dependency>
    <groupId>org.millarts</groupId>
    <artifactId>groovy-pluralize-en</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.millarts/groovy-pluralize-en/
implementation 'org.millarts:groovy-pluralize-en:0.2.1'
// https://jarcasting.com/artifacts/org.millarts/groovy-pluralize-en/
implementation ("org.millarts:groovy-pluralize-en:0.2.1")
'org.millarts:groovy-pluralize-en:jar:0.2.1'
<dependency org="org.millarts" name="groovy-pluralize-en" rev="0.2.1">
  <artifact name="groovy-pluralize-en" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.millarts', module='groovy-pluralize-en', version='0.2.1')
)
libraryDependencies += "org.millarts" % "groovy-pluralize-en" % "0.2.1"
[org.millarts/groovy-pluralize-en "0.2.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.codehaus.groovy : groovy-all jar 2.3.6
org.atteo : evo-inflector jar 1.2

test (1)

Идентификатор библиотеки Тип Версия
org.spockframework : spock-core jar 0.7-groovy-2.0

Модули Проекта

Данный проект не имеет модулей.

Groovy Pluralize Module

Build Status Maven Coordinates

A lightweight Groovy extension module that adds the functionality to get plural inflections for words. Suitable for most English applications.

For more robust needs, checkout IBM’s more comprehensive and feature rich International Components for Unicode library.

Installation

Include the jar is in your classpath, or add it as a dependency to your favorite build tool. Groovy does the rest.

Note
Requires groovy 2.0 or later.
Gradle and Grails
compile 'org.millarts:groovy-pluralize-en:0.2.1'
Groovy Grape
@Grapes(
  @Grab(group='org.millarts', module='groovy-pluralize-en', version='0.2.1')
)
Maven
<dependency>
  <groupId>org.millarts</groupId>
  <artifactId>groovy-pluralize-en</artifactId>
  <version>0.2.1</version>
</dependency>

Usage

Example Usages
// Plural Inflection
assert 'mustache'.plural() == 'mustaches'
assert 'wolf'.plural()     == 'wolves'

// Plural Inflection with Cardinality
assert 'codex'.plural(1) == 'codex'
assert 'codex'.plural(2) == 'codices'
assert 'codex'.plural(8) == 'codices'

// Capitalization
assert 'Life'.plural() == 'Lives'

// Unfortunately, capitalization does not behave consistently for certain words. EG:
assert 'Tooth'.plural() == 'teeth'

Building

This project uses gradle for builds, and includes wrapper scripts so that it is not necessary to explicitly install gradle to build and test the project.

Gradle Examples
$ ./gradlew tasks   (1)
$ ./gradlew jar     (2)
$ ./gradlew test    (3)
$ ./gradlew check   (4)
  1. Lists the available tasks for this project

  2. Builds the jar

  3. Runs tests

  4. Runs tests and checks (eg: code quality checks)

Under the Hood

This module uses the evo-inflector project under the hood, which is based off of Damian Conway’s paper An Algorithmic Approach to English Pluralization. It tends to get things right. See the evo-inflector project for more information.

License

This project is licensed under the terms of the Apache License, Version 2.0.

© 2014 David W Millar

Версии библиотеки

Версия
0.2.1