Documentation

Lwt

Table of Contents

Packages

Api
Modules
Views
Entity
Shared
Database
Core
Documentation

Interfaces

SchedulerInterface
A spaced-repetition scheduler.
TermScheduleRepositoryInterface
Persistence for FSRS memory state and review history.
ApiRoutableInterface
Interface for API handlers that participate in route dispatch.

Classes

Endpoints
Registry of API V1 endpoints.
Response
Standardized JSON response helper for API V1.
Application
Main application class that bootstraps and runs LWT.
ApiController
Controller for REST API endpoints.
CreateUser
DeleteUser
ListUsers
ToggleUserRole
ToggleUserStatus
UpdateUser
UserManagementController
Abstract base controller providing common functionality for all controllers.
GoogleTranslateClient
Wrapper class to get translation.
FeedEditController
Controller for feed CRUD operations.
FeedLoadController
Controller for feed loading/importing operations.
LanguageController
Controller for language configuration.
RecordScheduledReview
Record one graded review against a term's FSRS state.
Fsrs6Scheduler
FSRS-6, the memory model Anki uses.
FsrsParameters
FSRS-6 tuning parameters.
LegacyStatusSeed
Seeds FSRS memory state for a term that has never been graded.
MemoryState
A term's FSRS memory state: the whole of what the scheduler needs to decide when the term is next due.
SchedulingResult
What a scheduler returns for one graded review: the term's new memory state plus the interval it was scheduled with.
MySqlTermScheduleRepository
MySQL persistence for FSRS scheduling state.
WhisperClient
HTTP client for communicating with the NLP microservice Whisper endpoints.
AnkiDeckImportService
Creates LWT terms from a deck the user built in Anki (issue #228).
ApkgExportService
Orchestrates building an .apkg from one LWT language's terms.
ApkgImportService
Reads an .apkg and merges field/tag/suspension changes back into LWT terms.
ApkgTermMapper
Pure mapping between LWT Term entities and ApkgNote DTOs.
DeckImportResult
Outcome of importing a foreign Anki deck.
DeckImportSettings
What the user chose on the import-configuration screen.
ExportResult
Outcome of an .apkg export. Surfaced to controllers/CLI for user-facing confirmation messages.
ImportResult
Outcome of an .apkg import.
TermChange
Per-term diff produced by ApkgTermMapper::applyNoteToTerm. The orchestrator folds these into ImportResult counters; tests assert on individual fields.
FrequencyImportService
Fetches word frequency lists from the FrequencyWords project and bulk-imports them as starter vocabulary for a language.
FrequencyLanguageMap
Maps LWT language names to external frequency/dictionary source codes.
LemmatizerFactory
Factory for creating lemmatizers based on language configuration.
WiktionaryEnrichmentService
Enriches imported vocabulary with translations from kaikki.org (Wiktextract structured data) or monolingual definitions from Wiktionary APIs.
AnkiDeckImportController
Import a deck built in Anki as new LWT terms (issue #228).
ApkgController
HTTP entry points for round-trip Anki .apkg interop:
StarterVocabController
Controller for the starter vocabulary import flow.
AnkiFieldText
Turns an Anki field into the plain text LWT stores.
AnkiSchema
Anki collection.anki21 schema (legacy schema 11).
ApkgDeck
Identifies the Anki deck a batch of LWT notes will land in.
ApkgNote
Round-trippable representation of a single LWT term as an Anki note.
ApkgReader
Reads an .apkg file and yields ApkgNote objects.
ApkgWriter
Builds a .apkg file (zip containing a schema-11 SQLite collection) from LWT term data.
ForeignApkgReader
Reads an .apkg that LWT did not produce.
ForeignNote
One note from a foreign (non-LWT) Anki deck, with its fields left unmapped.
ForeignNotetype
A notetype found in an .apkg that LWT did not create.
HybridLemmatizer
Hybrid lemmatizer that combines dictionary and NLP-based approaches.
NlpServiceLemmatizer
Lemmatizer that uses the NLP microservice (spaCy).
EnvLoader
Simple .env file parser and loader.
Configuration
Database configuration and connection utilities.
Connection
Database connection wrapper providing a clean interface for database operations.
DB
Database facade providing a simplified interface for common operations.
Escaping
SQL escaping and text preparation utilities.
JapaneseTextParser
Japanese text parsing using MeCab.
Maintenance
Database maintenance and optimization utilities.
Migrations
Database migrations and initialization utilities.
ParsedToken
One token produced while parsing a text: a word or a non-word run (whitespace / punctuation).
PreparedStatement
Wrapper class for mysqli prepared statements.
QueryBuilder
Fluent query builder for constructing SQL queries.
SchemaConstraints
The declared foreign keys of the current schema.
ScratchTables
Creates the per-connection scratch table used while importing vocabulary.
Settings
Application settings management.
SqlFileParser
SQL file parser for reading and splitting SQL files into individual queries.
StandardTextParser
Standard text parsing with sentence splitting.
TextParsing
Text parsing and processing utilities (facade).
TokenPersistence
Turns a parsed token stream into `sentences` and `word_occurrences` rows, detecting multi-word expressions along the way — all in PHP.
Validation
Database ID and tag validation utilities.
Cors
Cross-Origin Resource Sharing (CORS) for the REST API.
InputValidator
Centralized input validation for request parameters.
UrlUtilities
URL handling utilities.
ErrorHandler
Error handling utilities.
StringUtils
String manipulation utilities.
ViteHelper
Helper class for Vite asset loading.
FormHelper
Helper class for generating HTML form attributes.
IconHelper
Helper class for rendering Lucide SVG icons.
PageLayoutHelper
Helper class for generating page layout elements.
SearchableSelectHelper
Helper class for rendering searchable select components.
SelectOptionsBuilder
Builder class for generating HTML select options.
TagHelper
Helper class for rendering tags with Bulma styling.

Traits

FeedFlashTrait
Shared flash message rendering for Feed controllers.
ApiRoutableTrait
Default implementations for ApiRoutableInterface methods.

Enums

Rating
The four FSRS review grades.
SchedulingState
Where a term sits in the scheduling lifecycle.

Functions

url()  : string
Generate a URL with the application base path prepended.
__()  : string
Translate a key using the i18n translator.
__e()  : string
Translate a key and HTML-escape the result for safe output in templates.
base_path()  : string
Get the configured application base path.

Functions

url()

Generate a URL with the application base path prepended.

url([string $path = '/' ]) : string

Use this for all internal links to ensure they work correctly when the application is installed in a subdirectory.

Parameters
$path : string = '/'

The path to generate URL for (should start with /)

Tags
example

url('/login') returns '/lwt/login' if APP_BASE_PATH=/lwt

url('/') returns '/lwt' if APP_BASE_PATH=/lwt

url('/assets/css/main.css') returns '/lwt/assets/css/main.css'

Return values
string

The full URL path with base path prepended

__()

Translate a key using the i18n translator.

__(string $key[, array<string, string|int> $params = [] ]) : string
Parameters
$key : string

Dot-notated translation key (e.g. "common.save")

$params : array<string, string|int> = []

Interpolation parameters

Return values
string

Translated string, or the raw key if translator is unavailable

__e()

Translate a key and HTML-escape the result for safe output in templates.

__e(string $key[, array<string, string|int> $params = [] ]) : string
Parameters
$key : string

Dot-notated translation key

$params : array<string, string|int> = []

Interpolation parameters

Return values
string

HTML-escaped translated string

base_path()

Get the configured application base path.

base_path() : string
Return values
string

The base path (e.g., '/lwt') or empty string for root

On this page

Search results