https://github.com/mitica/root-name
Extracts root name of a name.
https://github.com/mitica/root-name
name root root-name stemmer stemming
Last synced: 7 months ago
JSON representation
Extracts root name of a name.
- Host: GitHub
- URL: https://github.com/mitica/root-name
- Owner: mitica
- Created: 2018-03-10T08:08:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T07:09:53.000Z (over 7 years ago)
- Last Synced: 2025-02-06T22:45:20.800Z (8 months ago)
- Topics: name, root, root-name, stemmer, stemming
- Language: TypeScript
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# root-name
Extracts root name of a name.
Supported languages: `ro`, `ru`.
## Usage
``` js
import rootName from 'root-name'
const lang = 'ru'
rootName('Владимира Путина', lang) // Владимир Путин
rootName('Санкт-Петербургской', lang) // Санкт-ПетербургrootName('Federației Ruse', 'ro') // Federați Rus
rootName('Federația Rusă', 'ro') // Federați Rus
rootName('COMISIEI EUROPENe', 'ro') // COMISI EUROPE```
## API
### rootName(name: string, lang: string, options?: Options): string
```ts
export enum RuleAccuracy {
LOW = 0,
NORMAL = 1,
HIGH = 2
}export type Options = {
accuracy?: RuleAccuracy
minWordLength?: number
}
```