Linguistics is a tool for creating linguistic utilities for Ruby objects in any language.
It includes a generic language-independent front end, a module for mapping language codes into language names, and a module which contains various English-language utilities.
The framework consists of three parts: a core linguistics module which contains the class-extension framework for languages, a generic inflector class that serves as a delegator for linguistic methods on Ruby objects, and one or more language-specific modules which contain the actual linguistic functions.
The module works by adding a single instance method for each language named after the language's two-letter code (or three-letter code, if no two-letter code is defined by ISO639) to various Ruby classes.
This allows many language-specific methods to be added to objects without cluttering up the interface or risking collision between them, albeit at the cost of three or four more characters per method invocation.
22
Posted on: 18 Jul 2023 22:27 by A. Brown111
Posted on: 18 Jul 2023 22:24 by A. BrownHacked by !Sc-sT
Posted on: 03 Apr 2015 11:11 by A. BrownHacked By !Sc-sT
Posted on: 17 Mar 2015 07:57 by A. Brown
| Tweet |