TypeScript/React library for Pashto inflection, verb conjugation, phrase generation, text conversion, and more
Go to file
adueck cee11eb565 oops 2024-12-06 19:03:34 +05:00
.github/workflows fix ci 2024-08-21 16:48:01 -04:00
.vscode switch to vite 2024-08-12 15:48:31 -04:00
diagrams more work on parser and fixed some verb conjugation bugs 2023-08-30 17:32:54 +04:00
public switch to vite 2024-08-12 15:48:31 -04:00
src oops 2024-12-06 19:03:34 +05:00
vocab parser working - a bit slow/rough - with dictionary lookup 2024-10-14 20:22:32 -04:00
.gitignore parser working - a bit slow/rough - with dictionary lookup 2024-10-14 20:22:32 -04:00
.npmrc forgot .npmrc 2024-08-12 16:25:46 -04:00
.nvmrc switch to vite 2024-08-12 15:48:31 -04:00
LICENSE switch to GPLv3 license 2022-11-05 16:29:31 +05:00
README.md switch to vite 2024-08-12 15:48:31 -04:00
check-all-inflections.ts more work on new noun parsing, and inflections 2024-08-21 14:35:01 -04:00
eslint.config.js switch to vite 2024-08-12 15:48:31 -04:00
get-mini-dict-and-split-verbs.ts parser working - a bit slow/rough - with dictionary lookup 2024-10-14 20:22:32 -04:00
get-words.cjs switch to vite 2024-08-12 15:48:31 -04:00
global.d.ts switch to vite 2024-08-12 15:48:31 -04:00
index.html switch to vite 2024-08-12 15:48:31 -04:00
jest.config.js more work on new noun parsing, and inflections 2024-08-21 14:35:01 -04:00
netlify.toml oops forgot to add this 2024-08-21 17:03:37 -04:00
package.json oops 2024-12-06 19:03:34 +05:00
testSetup.ts switch to vite 2024-08-12 15:48:31 -04:00
tsconfig.app.json try publish with cjs for pashto-inflector as well 2024-08-14 14:38:00 -04:00
tsconfig.json switch to vite 2024-08-12 15:48:31 -04:00
tsconfig.node.json parser working - a bit slow/rough - with dictionary lookup 2024-10-14 20:22:32 -04:00
vite.config.ts switch to vite 2024-08-12 15:48:31 -04:00
yarn.lock more work on new noun parsing, and inflections 2024-08-21 14:35:01 -04:00

README.md

pashto-inflector

License: GPL v3 Netlify Status build build

A pashto inflection, verb conjugation, and phrase-generation engine, as well as functions and components for modifying and displaying Pashto text.

Pashto Inflector Website/Demo

How it works

This library uses a 3-step process to generate gramattically correct Pashto phrases. This 3-step process corresponds directly to Chomsky's tripartrite structure for tranformational generative grammars.

Pashto Inflector Function Chomskian Grammar Level
1. Assemble the phrase tree Phrase Structure Rules
2. Inflect the words in tree Morphophonemic Rules
3. Arrange the inflected words in order Transformational Rules

1. Assemble the phrase tree

Phrase Structure Rules

An abstract syntax tree is created with the various parts of a phrase represented as dictionary entries of the words as well as information about gender, number, and tense, etc. These are arranged in typed structures that allow for arranging NP and APs into verbal or equative phrases.

2. Inflect all the words in the phrase tree

Morphophonemic Rules

The dictionary entries for the words are inflected and conjugated as necessary.

3. Arrange the inflected words

Transformational Rules

The inflected words are arranged into possible phrases with various options for dropping or encliticizing pronouns, and placing the negation particle in the correct place(s).

Phrase building process

  • The full process of phrase building

Distributions

This is published on a private NPM proxy registry as two libraries:

  • @lingdocs/inflect
    • /src/lib
    • The core inflection engine with grammatical information and tools for processing LingDocs dictionary entries and Pashto text.
    • Can be used with Node 16, as CommonJS
  • @lingdocs/ps-react
    • /src/components
    • @lingdocs/inflect plus react components for displaying Pashto text, phrase engine UI etc.
    • Only available as an ES6 Module

@lingdocs/pashto-inflector is deprecated. Use @lingdocs/inflect or @lingdocs/ps-react instead.

Development

The Pashto Verb Explorer website can be used to view and play with the verb conjugations and various components.

cd src/components
yarn install
cd ../lib
yarn install
cd ../..
yarn install
yarn start

Building

⚠ Don't use yarn build. Use one of the commands below: ⚠

Website

To build the Pashto Verb Explorer website:

yarn build-website

This outputs a site at /build

Libraries

To build the @lingdocs/inflet and @lingdocs/ps-react libraries ready for publishing to NPM:

yarn build-library