Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

initials_inflator

Linrary provides a functions to inflate russian initials to the any cases with gender reccgnize using different rest api

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

initials_inflator #freepascal #lazarus

Library provides functions to inflate russian initials to any case with gender recognize using different rest api

Interface of library:

pascal
// Returns initials in needed case in array of strings with case as index
function GetInitials(Initials: string): CasesResponse;
pascal
// Returns words combination in needed case in array of strings with case as index
function GetWordsCase(Words: string): CasesResponse;
pascal
// Returns initials in needed case in simple string with gender in var-parameter
function GetGenderAndInitials(Initials: string; var Gender: TGender): CaseResponse;

where:

TWordCase = (Nominative, Gentitive, Dative, Accusative, Instrumental, Prepositional);

TGender = (Male, Female, Unrecognized);

CasesResponse = array[TWordCase] of string;

Use generics for RestApi service.

Implemented 2/3 services:

  1. Pymorphy https://github.com/kmike/pymorphy2 (inflates only separated words without context)
  2. Morphos http://morphos.io/site/api#inflect-name (best way imho)
  3. Dadata not implemented yet (I think best service but it's not free)