Introduction
Welcome to the Javanese AI documentation. Our engine provides advanced syntax analysis (S-P-O-K) and Unggah-Ungguh (politeness) validation for the Javanese language, serving as a bridge between traditional linguistics and modern NLP.
Pro Tip
This analyzer is optimized for Krama Inggil formal scripts but handles Ngoko with basic validation.
Installation
Choose the installation method that best fits your needs. You can install the core library, scaffold a complete application, or clone the full repository.
Option 1: Install Package (Library Usage)
Install the core analyzer as a dependency in your project.
Option 2: CLI Tool (Recommended - Full App)
Scaffold a complete Next.js application with the analyzer pre-configured.
Option 3: Template Repository
Use the template without git history.
Option 4: Clone Repository (Development)
Clone with full git history for development and contributions.
Quick Start
To analyze your first sentence, you can use our CLI tool or the web interface. Here is how to analyze a simple sentence structure.
import { analyze } from 'javanese-analyzer-core';
const result = analyze('Kula nedha sekul');
console.log(result);Syntax Analysis
Our engine uses a bespoke Context-Free Grammar (CFG) to parse sentences into their constituent parts. The analysis returns a hierarchical tree structure identifying the function of each word.
The actor or topic performing the action in the clause.
The core action or state being performed by the subject.
The entity acted upon by the verb.
Additional context like time, place, or manner.
Unggah-Ungguh
Politeness is paramount in Javanese. The engine checks for subject-verb agreement not just in number, but in social status.
Common Violation Example
Using Krama Inggil verbs for oneself.
Fuzzy Matching
The engine employs a Levenshtein distance algorithm to correct typos up to a specific threshold, ensuring robust analysis even with imperfect input.
| Input | Detected | Distance | Confidence |
|---|---|---|---|
| kulo | kula | 1 | High |
| mngan | mangan | 1 | Medium |
Analyze Endpoint
The primary endpoint for analyzing text.
/v1/analyzeParameters
Response Objects
Success response structure.
{
"status": "success",
"data": {
"sentence": "Kula nedha sekul",
"structure": {
"S": "Kula",
"P": "nedha",
"O": "sekul"
},
"valid": true,
"confidence": 0.98
}
}Error Codes
| Code | Description | Status |
|---|---|---|
| 400 | Bad Request (Invalid Input) | User Error |
| 422 | Validation Error (Unggah-Ungguh) | Logic Error |
| 500 | Internal Server Error | Server Error |