typed-japanese  by typedgrammar

DSL for Japanese grammar learning via TypeScript types

Created 6 months ago
1,837 stars

Top 23.5% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a type-level Domain-Specific Language (DSL) within TypeScript for expressing and verifying Japanese grammar. It targets developers and language learners who want to leverage the TypeScript compiler for grammatical correctness, offering a novel approach to AI-assisted language learning and grammar analysis.

How It Works

The system utilizes TypeScript's advanced type features, including template literal types, conditional types, and mapped types, to create a purely type-level representation of Japanese grammar. Grammatical rules are mapped via conditional types, and string literal manipulation generates various verb and adjective conjugations. This approach allows for compile-time validation of Japanese sentence structures, ensuring grammatical accuracy without runtime execution.

Quick Start & Requirements

  • Install dependencies: pnpm install
  • Run tests: pnpm test
  • Requires Node.js and pnpm.

Highlighted Details

  • Supports Godan, Ichidan, and Irregular verb classes with multiple conjugation forms (dictionary, polite, te-form, past, negative, potential, passive, causative, volitional, imperative, conditional, hypothetical).
  • Implements I-Adjectives and Na-Adjectives with supported conjugation forms.
  • Enables phrase and sentence composition, including particles, punctuation, and conditional expressions.
  • Explores an intermediate format for AI language learning, verifiable via TypeScript's type checker.

Maintenance & Community

  • Project maintained by Yifeng Wang.
  • Contact for sponsorship, research, or commercial inquiries: contact@typedgrammar.com.

Licensing & Compatibility

  • MIT License.
  • Permissive for commercial use and closed-source linking.

Limitations & Caveats

This is a type-level system with no runtime functionality. It may not capture all linguistic nuances or rare/archaic language patterns. The project is in early stages, and its reliance on LLM-generated grammar rules means occasional inaccuracies or hallucinations may occur.

Health Check
Last Commit

5 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
12 stars in the last 30 days

Explore Similar Projects

Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), and
42 more.

spaCy by explosion

0.1%
32k
NLP library for production applications
Created 11 years ago
Updated 3 months ago
Feedback? Help us improve.