EntityMention.fromJson constructor

EntityMention.fromJson(
  1. Object? j
)

Implementation

factory EntityMention.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return EntityMention(
    text: switch (json['text']) {
      null => null,
      Object $1 => TextSpan.fromJson($1),
    },
    type: switch (json['type']) {
      null => EntityMention_Type.$default,
      Object $1 => EntityMention_Type.fromJson($1),
    },
    sentiment: switch (json['sentiment']) {
      null => null,
      Object $1 => Sentiment.fromJson($1),
    },
    probability: switch (json['probability']) {
      null => 0,
      Object $1 => decodeDouble($1),
    },
  );
}