Skip to content

Converts a stream of strings into stream of tokens splitted by delimiters

License

Notifications You must be signed in to change notification settings

lesnitsky/tokenizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tokenizer

GitHub stars Twitter Follow

Converts a stream of strings into stream of tokens splitted by delimiters

Installation

dart pub add tokenizer

or

flutter pub add tokenizer

Example

import 'dart:async';

import 'package:tokenizer/tokenizer.dart';

void main(List<String> args) async {
  final string = 'Hello, world';
  final tokenizer = Tokenizer({',', ' '});
  final c = StreamController<String>();

  c.add(string);
  c.close();

  final tokens = await c.stream.transform(tokenizer.transformer).toList();
  print(tokens); // ["Hello", ",", " ", "world"]
}

License

MIT

About

Converts a stream of strings into stream of tokens splitted by delimiters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages