hors 0.9.2 copy "hors: ^0.9.2" to clipboard
hors: ^0.9.2 copied to clipboard

A simple Dart package to extract date and time from Russian texts.

example/example.dart

import 'dart:io';

import 'package:hors/hors.dart';

void main() async {
  stdout.write('Запуск термоядерного примера Hors 3000.\n');
  stdout.write('Введите строку для парсинга:\n\n');
  final hors = Hors(
    recognizers: Recognizer.all,
    tokenParsers: TokenParsers.all,
  );

  while (true) {
    stdout.write('> ');
    final input = stdin.readLineSync();
    if (input?.toLowerCase() == 'выход') break;

    final result = hors.parse(
      input ?? '',
      DateTime.now(),
    );

    if (result.textWithoutTokens.isNotEmpty) {
      stdout.write('\tText: ${result.textWithoutTokens}\n');
    }

    for (final token in result.tokens) {
      stdout.write('\t');
      stdout.write(token);
      stdout.write('\n');
    }

    stdout.write('\n');
  }
}
0
likes
140
points
30
downloads

Publisher

verified publishervorky.io

Weekly Downloads

A simple Dart package to extract date and time from Russian texts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on hors