### Get All Wordforms for a Verb Source: https://context7.com/pullenti/pullenticsharp/llms.txt Retrieves all possible grammatical forms for a given verb using MorphologyService.GetAllWordforms. Requires prior initialization of MorphologyService. ```csharp // Получение всех словоформ для слова List allForms = MorphologyService.GetAllWordforms("ЧИТАТЬ", MorphLang.RU); Console.WriteLine("Все формы глагола 'ЧИТАТЬ':"); foreach (MorphWordForm form in allForms) { Console.WriteLine($" {form.NormalCase} - {form.Number}, {form.Gender}, {form.Tense}"); } ``` -------------------------------- ### Get Specific Wordform Source: https://context7.com/pullenti/pullenticsharp/llms.txt Obtains a specific wordform for a given term based on provided morphological attributes like gender, number, and case using MorphologyService.GetWordform. ```csharp // Получение конкретной словоформы MorphBaseInfo targetMorph = new MorphBaseInfo() { Gender = MorphGender.Feminine, Number = MorphNumber.Singular, Case = MorphCase.Genitive }; string wordform = MorphologyService.GetWordform("КНИГА", targetMorph); Console.WriteLine($"\n'КНИГА' в родительном падеже: {wordform}"); // книги ``` -------------------------------- ### Fetch Latest Version with Make Source: https://github.com/pullenti/pullenticsharp/blob/master/README.md Use this command to download and unpack the latest version of the library from the official website. ```bash make fetch ``` -------------------------------- ### Initialize Pullenti C# SDK Source: https://context7.com/pullenti/pullenticsharp/llms.txt Initializes all SDK components for all supported languages or specific languages. Call this once at application startup. Shows how to check the SDK version and list available analyzers. ```csharp using Pullenti; using Pullenti.Ner; using Pullenti.Morph; // Полная инициализация SDK для всех поддерживаемых языков (RU, UA, EN) Pullenti.Sdk.InitializeAll(); // Проверка версии SDK Console.WriteLine($"Pullenti SDK версия: {Pullenti.Sdk.Version} ({Pullenti.Sdk.VersionDate})"); // Вывод: Pullenti SDK версия: 4.1 (2020.12.8) // Альтернативная инициализация только для выбранных языков Pullenti.Sdk.Initialize(MorphLang.RU | MorphLang.EN); // Просмотр доступных анализаторов foreach (Analyzer analyzer in ProcessorService.Analyzers) { Console.WriteLine($"{analyzer.Name}: {analyzer.Caption} (Specific: {analyzer.IsSpecific})"); } // Вывод: // MONEY: Деньги (Specific: False) // URI: URI (Specific: False) // PHONE: Телефоны (Specific: False) // DATE: Даты (Specific: False) // PERSON: Персоны (Specific: False) // GEO: Географические объекты (Specific: False) // ORGANIZATION: Организации (Specific: False) // ... ``` -------------------------------- ### Create Processor with Keyword Analyzer Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates creating a specialized processor that includes the KeywordAnalyzer for extracting keywords and phrases. Requires Pullenti.Sdk.InitializeAll(). ```csharp using Pullenti.Ner; using Pullenti.Ner.Keyword; string text = @"Программирование на языке Python является востребованным навыком. Машинное обучение и искусственный интеллект активно развиваются. Анализ данных требует знания статистики и математики."; Pullenti.Sdk.InitializeAll(); // Создание процессора с анализатором ключевых слов using (Processor proc = ProcessorService.CreateSpecificProcessor(KeywordAnalyzer.ANALYZER_NAME)) { AnalysisResult result = proc.Process(new SourceOfAnalysis(text), null, null); Console.WriteLine("Извлечённые ключевые слова и фразы:\n"); foreach (Referent entity in result.Entities) { if (entity is KeywordReferent keyword) { Console.WriteLine($"[{keyword.Typ}] {keyword}"); Console.WriteLine($" Ранг: {keyword.Rank}"); Console.WriteLine($" Дочерние элементы: {keyword.ChildWords}"); } } // Альтернативный способ извлечения через токены Console.WriteLine("\nКлючевые слова в контексте:"); for (Token t = result.FirstToken; t != null; t = t.Next) { if (t is ReferentToken rt && rt.GetReferent() is KeywordReferent kw) { string normalized = Pullenti.Ner.Core.MiscHelper.GetTextValueOfMetaToken( rt, Pullenti.Ner.Core.GetTextAttr.FirstNounGroupToNominativeSingle ); Console.WriteLine($" '{normalized}' => {kw}"); } } } ``` -------------------------------- ### Perform Morphological Analysis Source: https://context7.com/pullenti/pullenticsharp/llms.txt Shows how to perform morphological analysis on a given text using MorphologyService.Initialize and MorphologyService.Process. Supports multiple languages. ```csharp using Pullenti.Morph; using System.Collections.Generic; // Инициализация морфологии MorphologyService.Initialize(MorphLang.RU | MorphLang.EN); string text = "Красивые девушки читали интересные книги"; // Морфологический анализ текста List tokens = MorphologyService.Process(text, MorphLang.RU, null); Console.WriteLine("Морфологический разбор:\n"); foreach (MorphToken token in tokens) { Console.WriteLine($"Слово: '{token.Term}'"); Console.WriteLine($" Позиция: {token.BeginChar}-{token.EndChar}"); foreach (MorphWordForm wf in token.WordForms) { Console.WriteLine($" Форма: нормальная='{wf.NormalCase}', полная='{wf.NormalFull}'"); Console.WriteLine($" Часть речи: {wf.Class}"); Console.WriteLine($" Род: {wf.Gender}, Число: {wf.Number}, Падеж: {wf.Case}"); Console.WriteLine($" В словаре: {wf.IsInDictionary}"); } Console.WriteLine(); } ``` -------------------------------- ### ProcessorService.CreateSpecificProcessor Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates how to create a processor with specific analyzers, such as for keywords. This allows for targeted text analysis beyond the standard capabilities. ```APIDOC ## ProcessorService.CreateSpecificProcessor - Создание специализированного процессора ### Description Создаёт процессор с включением специфических анализаторов (например, для ключевых слов, оружия, банковских реквизитов), которые не включены в стандартный набор. ### Method POST (or equivalent for service creation) ### Endpoint /api/processor/createSpecific ### Parameters #### Query Parameters - **analyzerName** (string) - Required - The name of the specific analyzer to include (e.g., KeywordAnalyzer.ANALYZER_NAME). ### Request Example ```csharp // Example usage within C# code: using Pullenti.Ner; using Pullenti.Ner.Keyword; string text = "..."; Pullenti.Sdk.InitializeAll(); using (Processor proc = ProcessorService.CreateSpecificProcessor(KeywordAnalyzer.ANALYZER_NAME)) { AnalysisResult result = proc.Process(new SourceOfAnalysis(text), null, null); // Process the result... } ``` ### Response #### Success Response (200) - **processorId** (string) - An identifier for the created processor instance. #### Response Example ```json { "processorId": "unique-processor-instance-id" } ``` ### Error Handling - **400 Bad Request**: If the analyzer name is invalid or not found. - **500 Internal Server Error**: For other processing issues. ``` -------------------------------- ### Commit and Push Code Changes Source: https://github.com/pullenti/pullenticsharp/blob/master/README.md Follow these steps to stage, commit, and push your code modifications to the repository. ```bash git add . ``` ```bash git commit -m 'Mirror 3.23' ``` ```bash git push ``` -------------------------------- ### Initialize and Process Text with Pullenti Analyzers Source: https://context7.com/pullenti/pullenticsharp/llms.txt Initializes all Pullenti analyzers and processes a complex text to demonstrate entity recognition. It then groups and prints entities by type, extracting specific details for each recognized entity. ```csharp using Pullenti.Ner; using Pullenti.Ner.Address; using Pullenti.Ner.Bank; using Pullenti.Ner.Date; using Pullenti.Ner.Decree; using Pullenti.Ner.Geo; using Pullenti.Ner.Money; using Pullenti.Ner.Org; using Pullenti.Ner.Person; using Pullenti.Ner.Phone; using Pullenti.Ner.Uri; Pullenti.Sdk.InitializeAll(); // Комплексный текст для демонстрации всех типов сущностей string text = @" Иванов Иван Иванович, директор ООО ""Рога и Копыта"" (ИНН 7707083893), зарегистрированного по адресу: г. Москва, ул. Тверская, д. 15, офис 301, заключил договор № 123/2024 от 15 января 2024 года на сумму 1.500.000 (один миллион пятьсот тысяч) рублей 00 копеек. Контакты: тел. +7 (495) 123-45-67, email: info@example.com, сайт: https://www.example.com Согласно Федеральному закону от 26.12.1995 № 208-ФЗ "Об акционерных обществах"... "; using (Processor proc = ProcessorService.CreateProcessor()) { AnalysisResult result = proc.Process(new SourceOfAnalysis(text), null, null); // Группировка сущностей по типам var entitiesByType = result.Entities.GroupBy(e => e.TypeName); foreach (var group in entitiesByType) { Console.WriteLine($"\n=== {group.Key} ({group.Count()}) ==="); foreach (Referent entity in group) { Console.WriteLine($" • {entity}"); // Специфичная информация для каждого типа switch (entity) { case PersonReferent person: Console.WriteLine($" ФИО: {person.GetStringValue("LASTNAME")} " + $"{person.GetStringValue("FIRSTNAME")} {person.GetStringValue("MIDDLENAME")}"); break; case OrganizationReferent org: Console.WriteLine($" Тип: {org.GetStringValue("TYPE")}"); Console.WriteLine($" ИНН: {org.GetStringValue("INN")}"); break; case GeoReferent geo: Console.WriteLine($" Тип: {geo.GetStringValue("TYPE")}"); Console.WriteLine($" Alpha2: {geo.GetStringValue("ALPHA2")}"); break; case AddressReferent addr: Console.WriteLine($" Улица: {addr.GetStringValue("STREET")}"); Console.WriteLine($" Дом: {addr.GetStringValue("HOUSE")}"); break; case MoneyReferent money: Console.WriteLine($" Сумма: {money.GetStringValue("VALUE")}"); Console.WriteLine($" Валюта: {money.GetStringValue("CURRENCY")}"); break; case PhoneReferent phone: Console.WriteLine($" Номер: {phone.GetStringValue("NUMBER")}"); break; case UriReferent uri: Console.WriteLine($" Схема: {uri.GetStringValue("SCHEME")}"); Console.WriteLine($" Значение: {uri.GetStringValue("VALUE")}"); break; } } } } ``` -------------------------------- ### Extract Noun Phrases with Normalization Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates extracting noun phrases and their normalized forms using NounPhraseHelper.TryParse in standard mode. Ensure Pullenti.Sdk.InitializeAll() is called before processing. ```csharp using Pullenti.Ner; using Pullenti.Ner.Core; using Pullenti.Morph; Pullenti.Sdk.InitializeAll(); string text = "Российская Федерация является крупнейшим государством мира с богатой историей"; // Обработка текста пустым процессором для получения токенов AnalysisResult result = ProcessorService.EmptyProcessor.Process( new SourceOfAnalysis(text), null, null ); Console.WriteLine("Именные группы:\n"); for (Token t = result.FirstToken; t != null; t = t.Next) { // Попытка выделить именную группу с текущего токена NounPhraseToken npt = NounPhraseHelper.TryParse( t, NounPhraseParseAttr.No, // Стандартный режим 0, // Без ограничения позиции null // Без внешнего существительного ); if (npt == null) continue; // Исходный текст группы string source = npt.GetSourceText(); // Нормализованная форма (единственное число, именительный падеж) string normalized = npt.GetNormalCaseText( null, MorphNumber.Singular, MorphGender.Undefined, false ); Console.WriteLine($"Исходный текст: '{source}'"); Console.WriteLine($" Нормализовано: '{normalized}'"); Console.WriteLine($" Существительное: '{npt.Noun}'"); Console.WriteLine($" Падеж: {npt.Morph.Case}"); Console.WriteLine($" Число: {npt.Morph.Number}"); Console.WriteLine(); // Перемещаем указатель на конец группы t = npt.EndToken; } // Режим с предлогом Token firstToken = result.FirstToken; NounPhraseToken nptWithPrep = NounPhraseHelper.TryParse( firstToken, NounPhraseParseAttr.ParsePreposition, // Учитывать предлоги 0, null ); // Вывод: // Исходный текст: 'Российская Федерация' // Нормализовано: 'РОССИЙСКАЯ ФЕДЕРАЦИЯ' // Существительное: 'Федерация' // Падеж: Nominative // Число: Singular // // Исходный текст: 'крупнейшим государством' // Нормализовано: 'КРУПНЕЙШЕЕ ГОСУДАРСТВО' // Существительное: 'государством' // Падеж: Instrumental // Число: Singular ``` -------------------------------- ### Check Code Changes with Git Source: https://github.com/pullenti/pullenticsharp/blob/master/README.md These commands help you view the differences in your local repository compared to the fetched version. ```bash git status ``` ```bash git diff ``` -------------------------------- ### Integrate External Ontology with Pullenti Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates how to create an external ontology, add reference entities (persons, organizations), and process text with the ontology to link extracted entities. ```csharp using Pullenti.Ner; using Pullenti.Ner.Person; using Pullenti.Ner.Org; Pullenti.Sdk.InitializeAll(); // Создание внешней онтологии ExtOntology ontology = new ExtOntology(); // Добавление эталонных персон PersonReferent knownPerson = new PersonReferent(); knownPerson.AddSlot(PersonReferent.ATTR_LASTNAME, "ПУТИН", false, 0); knownPerson.AddSlot(PersonReferent.ATTR_FIRSTNAME, "ВЛАДИМИР", false, 0); ExtOntologyItem personItem = ontology.Add(knownPerson); personItem.Tag = "person_001"; // Идентификатор в базе знаний // Добавление эталонных организаций OrganizationReferent knownOrg = new OrganizationReferent(); knownOrg.AddSlot(OrganizationReferent.ATTR_NAME, "ГАЗПРОМ", false, 0); knownOrg.AddSlot(OrganizationReferent.ATTR_TYPE, "компания", false, 0); ExtOntologyItem orgItem = ontology.Add(knownOrg); orgItem.Tag = "org_gazprom"; string text = "Путин посетил штаб-квартиру Газпрома в Санкт-Петербурге."; using (Processor proc = ProcessorService.CreateProcessor()) { // Передача онтологии в процессор AnalysisResult result = proc.Process( new SourceOfAnalysis(text), ontology, // Внешняя онтология null ); foreach (Referent entity in result.Entities) { Console.WriteLine($"Сущность: {entity}"); // Проверка привязки к онтологии if (entity.OntologyItems != null && entity.OntologyItems.Count > 0) { foreach (ExtOntologyItem item in entity.OntologyItems) { Console.WriteLine($" Привязана к: {item.Referent} (ID: {item.Tag})"); } } else { Console.WriteLine(" Не привязана к онтологии"); } Console.WriteLine(); } } // Вывод: // Сущность: Путин // Привязана к: Владимир Путин (ID: person_001) // // Сущность: Газпром // Привязана к: компания Газпром (ID: org_gazprom) // // Сущность: Санкт-Петербург // Не привязана к онтологии ``` -------------------------------- ### Perform Semantic Analysis with Pullenti C# Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates how to perform semantic analysis on text after an initial NER pass. This process extracts semantic relationships and builds a semantic graph. Requires prior NER analysis results. ```csharp using Pullenti.Ner; using Pullenti.Semantic; Pullenti.Sdk.InitializeAll(); string text = @"Программист написал сложную программу. Клиент заказал быструю доставку товара."; using (Processor proc = ProcessorService.CreateProcessor()) { // Сначала NER-анализ AnalysisResult nerResult = proc.Process(new SourceOfAnalysis(text), null, null); // Затем семантический анализ SemProcessParams pars = new SemProcessParams(); SemDocument semDoc = SemanticService.Process(nerResult, pars); Console.WriteLine($"Семантический анализ версия: {SemanticService.Version}"); Console.WriteLine($"Количество блоков: {semDoc.Blocks.Count}\n"); foreach (SemBlock block in semDoc.Blocks) { Console.WriteLine($"Блок: {block}"); foreach (SemFragment fragment in block.Fragments) { Console.WriteLine($" Фрагмент: {fragment}"); // Анализ семантических связей if (fragment.Graph != null) { Console.WriteLine($" Граф связей:"); foreach (var item in fragment.Graph.Items) { Console.WriteLine($" - {item}"); } } } Console.WriteLine(); } } ``` -------------------------------- ### Create and Use ProcessorService for Text Analysis Source: https://context7.com/pullenti/pullenticsharp/llms.txt Creates a linguistic processor with standard analyzers to extract named entities from text. Processes the text and iterates through found entities and their attributes. ```csharp using Pullenti.Ner; string text = @"Компания ООО ""Яндекс"" была основана Аркадием Воложем в 1997 году в Москве. Офис расположен по адресу: ул. Льва Толстого, д. 16. Контактный телефон: +7 (495) 739-70-00. Уставный капитал составляет 1.500.000 рублей."; // Инициализация SDK Pullenti.Sdk.InitializeAll(); // Создание стандартного процессора using (Processor proc = ProcessorService.CreateProcessor()) { // Обработка текста AnalysisResult result = proc.Process(new SourceOfAnalysis(text), null, null); // Вывод всех найденных сущностей Console.WriteLine($"Найдено {result.Entities.Count} сущностей:\n"); foreach (Referent entity in result.Entities) { Console.WriteLine($"[{entity.TypeName}] {entity}"); // Вывод атрибутов сущности foreach (Slot slot in entity.Slots) { Console.WriteLine($" - {slot.TypeName}: {slot.Value}"); } Console.WriteLine(); } } // Вывод: // [ORGANIZATION] ООО "Яндекс" // - TYPE: ООО // - NAME: ЯНДЕКС // - GEO: Москва // // [PERSON] Аркадий Волож // - FIRSTNAME: АРКАДИЙ // - LASTNAME: ВОЛОЖ // // [GEO] Москва // - NAME: МОСКВА // - TYPE: город // // [DATE] 1997 год // - YEAR: 1997 // // [ADDRESS] ул. Льва Толстого, д. 16 // - STREET: улица Льва Толстого // - HOUSE: 16 // // [PHONE] +7 (495) 739-70-00 // - NUMBER: +74957397000 // - COUNTRYCODE: 7 // // [MONEY] 1.500.000 рублей // - VALUE: 1500000 // - CURRENCY: RUB ``` -------------------------------- ### Process Text with NER using Pullenti C# Source: https://context7.com/pullenti/pullenticsharp/llms.txt Demonstrates how to process text to identify and extract named entities. Shows how to access entity attributes (slots), retrieve specific attribute types (name, year), check occurrences in text, and perform type-specific entity handling (Person, Organization, Geo). Includes entity serialization to XML and comparison. ```csharp using Pullenti.Ner; using Pullenti.Ner.Person; using Pullenti.Ner.Org; using Pullenti.Ner.Geo; Pullenti.Sdk.InitializeAll(); string text = @"Президент России Владимир Путин встретился с главой компании Газпром Алексеем Миллером в Кремле."; using (Processor proc = ProcessorService.CreateProcessor()) { AnalysisResult result = proc.Process(new SourceOfAnalysis(text), null, null); foreach (Referent entity in result.Entities) { Console.WriteLine($"=== {entity.TypeName}: {entity} ==="); // Доступ к атрибутам через слоты foreach (Slot slot in entity.Slots) { Console.WriteLine($" [{slot.TypeName}] = {slot.Value} (count: {slot.Count})"); } // Получение строкового значения атрибута string name = entity.GetStringValue("NAME"); if (name != null) Console.WriteLine($" Имя: {name}"); // Получение числового значения int year = entity.GetIntValue("YEAR", 0); if (year > 0) Console.WriteLine($" Год: {year}"); // Проверка вхождения в текст Console.WriteLine($" Вхождений в текст: {entity.Occurrence.Count}"); foreach (TextAnnotation occ in entity.Occurrence) { Console.WriteLine($" Позиция: {occ.BeginChar}-{occ.EndChar}"); } // Типизированная работа с конкретными сущностями if (entity is PersonReferent person) { Console.WriteLine($" Имя: {person.GetStringValue(PersonReferent.ATTR_FIRSTNAME)}"); Console.WriteLine($" Фамилия: {person.GetStringValue(PersonReferent.ATTR_LASTNAME)}"); } if (entity is OrganizationReferent org) { Console.WriteLine($" Тип организации: {org.GetStringValue(OrganizationReferent.ATTR_TYPE)}"); } if (entity is GeoReferent geo) { Console.WriteLine($" Тип местности: {geo.GetStringValue(GeoReferent.ATTR_TYPE)}"); } // Сериализация сущности в XML string xml = entity.Serialize(); Console.WriteLine($" XML: {xml.Substring(0, Math.Min(100, xml.Length))}..."); Console.WriteLine(); } // Сравнение сущностей if (result.Entities.Count >= 2) { Referent e1 = result.Entities[0]; Referent e2 = result.Entities[1]; bool areEqual = e1.CanBeEquals(e2, Pullenti.Ner.Core.ReferentsEqualType.WithinOneText); Console.WriteLine($"Сущности '{e1}' и '{e2}' равны: {areEqual}"); } } // Вывод: // === PERSON: Владимир Путин === // [FIRSTNAME] = ВЛАДИМИР (count: 1) // [LASTNAME] = ПУТИН (count: 1) // Вхождений в текст: 1 // Позиция: 18-32 // Имя: ВЛАДИМИР // Фамилия: ПУТИН // XML: ВЛАДИМИРПУТИН... ``` ```text === PERSON: Владимир Путин === [FIRSTNAME] = ВЛАДИМИР (count: 1) [LASTNAME] = ПУТИН (count: 1) Вхождений в текст: 1 Позиция: 18-32 Имя: ВЛАДИМИР Фамилия: ПУТИН XML: ВЛАДИМИРПУТИН... ``` -------------------------------- ### Manage Processor Timeout and Progress Events Source: https://context7.com/pullenti/pullenticsharp/llms.txt Configure the maximum processing time for text analysis and subscribe to progress events to monitor long-running operations. Handles potential timeouts and exceptions during processing. ```csharp using Pullenti.Ner; using System.ComponentModel; Pullenti.Sdk.InitializeAll(); string veryLongText = new string('А', 100000) + " Москва " + new string('Б', 100000); using (Processor proc = ProcessorService.CreateProcessor()) { // Установка таймаута в секундах proc.TimeoutSeconds = 30; // Подписка на события прогресса proc.Progress += (sender, e) => { if (e.ProgressPercentage >= 0) { Console.WriteLine($"Прогресс: {e.ProgressPercentage}%"); } if (e.UserState != null) { Console.WriteLine($"Сообщение: {e.UserState}"); } }; try { AnalysisResult result = proc.Process(new SourceOfAnalysis(veryLongText), null, null); // Проверка, был ли прерван процесс по таймауту if (result.IsTimeoutBreaked) { Console.WriteLine("Обработка прервана по таймауту!"); } // Просмотр лога обработки Console.WriteLine("\nЛог обработки:"); foreach (string logEntry in result.Log) { Console.WriteLine($" {logEntry}"); } // Проверка исключений if (result.Exceptions.Count > 0) { Console.WriteLine("\nОшибки:"); foreach (Exception ex in result.Exceptions) { Console.WriteLine($" {ex.Message}"); } } Console.WriteLine($"\nНайдено сущностей: {result.Entities.Count}"); } catch (Exception ex) { Console.WriteLine($"Ошибка обработки: {ex.Message}"); } // Принудительное прерывание (из другого потока) // proc.BreakProcess(); } // Вывод: // Прогресс: 0% // Сообщение: Морфологический анализ // Прогресс: 10% // Сообщение: Морфологический анализ завершён // Прогресс: 15% // Сообщение: Работа "Деньги" // ... // Лог обработки: // Из 200010 символов текста выделено 3 термов за 250 ms, базовый язык RU // Анализатор "Деньги" выделил 0 объект(ов) за 5ms // ... ``` -------------------------------- ### MorphologyService.Process Source: https://context7.com/pullenti/pullenticsharp/llms.txt Performs morphological analysis on a given text, returning detailed grammatical information for each word, including part of speech, gender, number, and case. ```APIDOC ## MorphologyService.Process - Морфологический анализ ### Description Сервис морфологического анализа (POS-tagger) для получения всех возможных грамматических форм слов, включая часть речи, род, число, падеж и другие характеристики. ### Method POST ### Endpoint /api/morphology/process ### Parameters #### Request Body - **text** (string) - Required - The text to analyze. - **language** (string) - Required - The language code for analysis (e.g., "RU" for Russian, "EN" for English). ### Request Example ```json { "text": "Красивые девушки читали интересные книги", "language": "RU" } ``` ### Response #### Success Response (200) - **tokens** (array) - An array of MorphToken objects, each representing a word or token in the text. - **term** (string) - The word itself. - **beginChar** (integer) - The starting character index of the token in the original text. - **endChar** (integer) - The ending character index of the token in the original text. - **wordForms** (array) - An array of MorphWordForm objects, representing different grammatical forms of the word. - **normalCase** (string) - The base or nominative form of the word. - **normalFull** (string) - The full base form. - **klass** (string) - The part of speech (e.g., "Adjective", "Noun"). - **gender** (string) - The grammatical gender (e.g., "Undefined", "Feminine", "Masculine"). - **number** (string) - The grammatical number (e.g., "Singular", "Plural"). - **case** (string) - The grammatical case (e.g., "Nominative", "Genitive"). - **isInDictionary** (boolean) - Indicates if the word form is present in the dictionary. #### Response Example ```json { "tokens": [ { "term": "КРАСИВЫЕ", "beginChar": 0, "endChar": 8, "wordForms": [ { "normalCase": "КРАСИВЫЙ", "normalFull": "КРАСИВЫЙ", "klass": "Adjective", "gender": "Undefined", "number": "Plural", "case": "Nominative", "isInDictionary": true } ] } // ... other tokens ] } ``` ### Error Handling - **400 Bad Request**: If the input text or language is invalid. - **500 Internal Server Error**: For other processing issues. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.