The texts representing named entities.
559038
def named_entity_texts(self):
        """"""
        if not self.is_tagged(NAMED_ENTITIES):
            self.tag_named_entities()
        return self.texts(NAMED_ENTITIES)
547827
private Entities toEntities(final JsonNode node, String text) throws IOException {
		if (null == node || node.isNull() || node.isMissingNode()) {
			return null;
		}
		final ObjectMapper mapper = this.createMapper();
		Entities entities = mapper.readerFor(Entities.class).readValue(node);
		extractTickerSymbolEntitiesFromText(text, entities);
		return entities;
	}
783697
def labels(self):
        
        return set([n.taxon.label for n in self._tree.leaf_nodes()])
429798
private Set<String> getMappedCorpora(List<String> originalNames)
  {
    WebResource rootRes = Helper.getAnnisWebResource();
    Set<String> mappedNames = new HashSet<>();
    // iterate over given corpora and map names if necessary
    for (String selectedCorpusName : originalNames)
    {
      // get the real corpus descriptions by the name (which could be an alias)
      try
      {
        List<AnnisCorpus> corporaByName
          = rootRes.path("query").path("corpora").path(urlPathEscape.escape(
              selectedCorpusName))
          .get(new GenericType<List<AnnisCorpus>>()
          {
          });

        if (corporaByName != null && !corporaByName.isEmpty())
        {
          for (AnnisCorpus c : corporaByName)
          {
            mappedNames.add(c.getName());
          }
        }
      }
      catch (ClientHandlerException ex)
      {
        String msg = "alias mapping does not work for alias: "
          + selectedCorpusName;
        log.error(msg, ex);
        Notification.show(msg, Notification.Type.TRAY_NOTIFICATION);
      }
    }
    return mappedNames;
  }
1337408
def fnames(self, names):
        """"""
        names = list(names[:len(self._fnames)])
        self._fnames = names + self._fnames[len(names):]
642581
def get_labels_and_texts(self, metadata=None):
		'''
		
		'''
		to_ret = {'categories': self._corpus.get_categories(), 'labels': [], 'texts': []}
		labels = self._corpus._y.astype(int)
		texts = self._get_texts_to_display()
		if self._use_non_text_features:
			to_ret['extra'] = []
			extrafeats = self._corpus.list_extra_features()
		if metadata is not None:
			to_ret['meta'] = []
		for label_i in range(len(self._corpus._category_idx_store)):
			label_indices = np.arange(0, len(labels))[labels == label_i]
			if self.max_per_category < len(label_indices):
				label_indices = np.random.choice(label_indices, self.max_per_category, replace=False)
				to_ret['labels'] += list([int(e) for e in labels[label_indices]])
				to_ret['texts'] += list(texts[label_indices])
				if metadata is not None:
					to_ret['meta'] += [metadata[i] for i in label_indices]
				if self._use_non_text_features:
					to_ret['extra'] += [extrafeats[i] for i in label_indices]

		return to_ret
653247
def normalized_messages(self, no_field_name='_entity'):
        """"""
        if isinstance(self.messages, dict):
            return self.messages
        if not self.field_names:
            return {no_field_name: self.messages}

        return dict((name, self.messages) for name in self.field_names)
973704
protected void entity() {
        nextChar();
        String name = null;
        if (ch == '#') {
            int namep = bp;
            nextChar();
            if (isDecimalDigit(ch)) {
                nextChar();
                while (isDecimalDigit(ch))
                    nextChar();
                name = new String(buf, namep, bp - namep);
            } else if (ch == 'x' || ch == 'X') {
                nextChar();
                if (isHexDigit(ch)) {
                    nextChar();
                    while (isHexDigit(ch))
                        nextChar();
                    name = new String(buf, namep, bp - namep);
                }
            }
        } else if (isIdentifierStart(ch)) {
            name = readIdentifier();
        }

        if (name != null) {
            if (ch != ';')
                return;
            nextChar();
        }
    }
602619
def get_spacy_entites(self, text: str) -> list:
        
        # NOTE: spaCy doc
        doc = self._language_model(text)

        entities = [{"entity": ent.label_,
                     "value": ent.text,
                     "start": ent.start_char,
                     "end": ent.end_char} for ent in doc.ents]

        return entities
325578
def query_names(self, pat):
        """"""

        for item in self.chnames.items():
            if fnmatch.fnmatchcase(item[1], pat):
                print item
669793
def names(self):
        """"""
        if is_term(self.terms):
            return frozenset([self.terms.name])
        return frozenset(term.name for term in com.flatten(self.terms))
91581
def named_entity_labels(self):
        """"""
        if not self.is_tagged(NAMED_ENTITIES):
            self.tag_named_entities()
        return [ne[LABEL] for ne in self[NAMED_ENTITIES]]
957371
def named_entity_spans(self):
        """"""
        if not self.is_tagged(NAMED_ENTITIES):
            self.tag_named_entities()
        return self.spans(NAMED_ENTITIES)
762944
def entities(self, name_id):
        
        cni = code(name_id)
        return list(self._db[cni].keys())
1039587
def help_text(self):
    """"""
    result = []
    for name in sorted(self._declarations.keys()):
      result.append(name)
      result.append('-' * len(name))
      decl = self._declarations[name]
      if decl.description:
        result.append(decl.description.strip())
      else:
        result.append('(no description found)')
      if decl.has_default:
        result.append('')
        quotes = '"' if type(decl.default_value) is str else ''
        result.append('  default_value={quotes}{val}{quotes}'.format(
            quotes=quotes, val=decl.default_value))
      result.append('')
      result.append('')
    return '\n'.join(result)
322330
def tags(self):
        
        # See also. Sentence.__repr__().
        ch, I,O,B = self.chunk, INSIDE+"-", OUTSIDE, BEGIN+"-"
        tags = [OUTSIDE for i in range(len(self.sentence.token))]
        for i, tag in enumerate(self.sentence.token): # Default: [WORD, POS, CHUNK, PNP, RELATION, ANCHOR, LEMMA]
            if tag == WORD:
                tags[i] = encode_entities(self.string)
            elif tag == POS and self.type:
                tags[i] = self.type
            elif tag == CHUNK and ch and ch.type:
                tags[i] = (self == ch[0] and B or I) + ch.type
            elif tag == PNP and self.pnp:
                tags[i] = (self == self.pnp[0] and B or I) + "PNP"
            elif tag == REL and ch and len(ch.relations) > 0:
                tags[i] = ["-".join([str(x) for x in [ch.type]+list(reversed(r)) if x]) for r in ch.relations]
                tags[i] = "*".join(tags[i])
            elif tag == ANCHOR and ch:
                tags[i] = ch.anchor_id or OUTSIDE
            elif tag == LEMMA:
                tags[i] = encode_entities(self.lemma or "")
            elif tag in self.custom_tags:
                tags[i] = self.custom_tags.get(tag) or OUTSIDE
        return tags
1316616
def babelfy(self, text, params=None):
        
        self._entities = list()
        self._all_entities = list()
        self._merged_entities = list()
        self._all_merged_entities = list()
        self._text = " ".join(word.strip() for word in text.split())

        params = params or self._params
        params['key'] = self._api_key
        params['text'] = self._text
        if (sys.version < '3' and isinstance(params['text'], unicode)) or (sys.version >= '3' and isinstance(params['text'], bytes)): #pylint: disable=undefined-variable
            params['text'] = params['text'].encode('utf-8')
        url = BABELFY_API_URL + '?' + urlencode(params)

        request = Request(url)
        request.add_header('Accept-encoding', 'gzip')
        response = urlopen(request)
        if sys.version < '3':
            buf = StringIO(response.read())
        else:
            buf = BytesIO(response.read())
        f = gzip.GzipFile(fileobj=buf)
        reader = codecs.getreader('utf-8')
        self._data = json.load(reader(f))