managarten/packages/shared-utils/src/parsers/index.ts
Till JS 5286404129 feat(parsers): add intelligent quick-create parsers for 6 apps with multilingual support
- Base parser: multilingual (DE/EN/FR/ES/IT) date, time, weekday, month parsing
- Base parser: fuzzy/typo tolerance (Levenshtein), recurrence (RRULE), relative time
- Base parser: timezone extraction, date ranges, ordinal dates, confidence scoring
- Base parser: past dates (gestern/yesterday), this/next week distinction
- Base parser: compose helper (createAppParser), multiple @references
- Calendar: event-parser with duration, time ranges, location, all-day, calendar ref
- Calendar: wire up UnifiedBar with onCreate/onParseCreate for quick event creation
- Todo: task-parser multilingual priority keywords (urgent/important/normal/later)
- Planta: plant-parser with acquisition keywords (gekauft/bought/acheté)
- Mukke: song-parser with Artist-Title format, BPM, genre, playlist/project creation
- NutriPhi: meal-parser with meal type detection, add QuickInputBar to layout
- All parsers: 210 tests across 7 test suites, all passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:18:05 +01:00

38 lines
731 B
TypeScript

/**
* Natural Language Parsers
*
* Base parser with common patterns, extended by app-specific parsers.
* Supports locales: de, en, fr, es, it
*/
export {
// Types
type BaseParsedInput,
type ExtractResult,
type ParserLocale,
type DateRange,
type ExtractionStep,
// Extraction functions
extractDate,
extractDateRange,
extractTime,
extractTimezone,
extractTags,
extractAtReference,
extractAtReferences,
extractRecurrence,
extractRelativeTime,
// Combination
combineDateAndTime,
// Preview formatting
formatDatePreview,
formatTimePreview,
formatDateTimePreview,
// Main parser
parseBaseInput,
// Compose helper
createAppParser,
// Utilities
cleanTitle,
fuzzyMatchDateKeyword,
} from './base-parser';