# syntax_analyzer

> Syntax analyzer for Russian based on context-free grammar. Adoption of Constantin Constantinov's python project

Latest version **0.0.2** (published 2020-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install syntax_analyzer
pnpm add syntax_analyzer
yarn add syntax_analyzer
bun add syntax_analyzer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-03-25 |
| First published | 2020-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 48 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michel Holz |
| Maintainers | ratinparadise |
| Keywords | language, processing, morphology, syntax, words, names, parse, Russian |

## Links

- npm: https://www.npmjs.com/package/syntax_analyzer
- npm.io page: https://npm.io/package/syntax_analyzer

## Dependencies (1)

- [az](https://npm.io/package/az.md) ^0.2.3

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-03-25
- 0.0.1 — 2020-03-15

## README

# Syntax Analyzer

Node.js adoption of https://github.com/constantin50/syntax_analyzer

This is syntax analyzer for Russian based on context-free grammar. 
It uses OpenCorpora dictionary of labelled words and AZ module as interface. 

The repository consitsts of two main parts: 

(1) parse_tree - class of binary tree to represent structure of sentence

(2) analyzer - parser that takes raw sentence and returns set of possible parse-trees

There are also complements: 

grammar.json - context-free grammar for russian

dict - dictionary of some complex phrases (conjugations, predicatives, adverbs etc.) that don't present in OpenCorpora dictionary.


# Example:

node run.js "Я пишу письмо старому другу"

    S     
       NP[case='nomn'] 
           
           Я ['NPRO', 'sing', '1per', 'nomn']
           
    VP[tran]
     
     VP[tran]
               
               VP[tran] 
                       
                       пишу ['VERB', 'sing', '1per', 'tran', 'pres']
               
               NP[case='accs'] 
                       
                       письмо ['NOUN', 'sing', 'neut', 'accs']
     
     NP[case='datv']
               
               NP[case='datv'] 
                       
                       старому ['NOUN', 'sing', 'neut', 'datv']
               
               NP[case='datv'] 
                       
                       другу ['NOUN', 'sing', 'datv']

---
_Source: https://npm.io/package/syntax_analyzer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
