annotate method

Future<List> annotate(
  1. String text
)

annotates.

Implementation

Future<List> annotate(String text) async {
  assert(!_isClosed);
  assert(_hasBeenOpened);
  //_hasBeenOpened = true;
  final List reply = await GoogleNLP.channel.invokeMethod<dynamic>(
    'EntityExtractor#annotate',
    <String, dynamic>{
      'handle': _handle,
      'options': {'text': text}
    },
  );
  final List<EntityAnnotation> annotations = <EntityAnnotation>[];
  for (final dynamic data in reply) {
    annotations.add(EntityAnnotation._(data));
  }

  return annotations;
}