Skip to content

Commit

Permalink
removing bug when "|" is part of a token
Browse files Browse the repository at this point in the history
  • Loading branch information
julsal committed May 24, 2018
1 parent 26e60c9 commit 9207f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# What is Indra?

Indra is an efficient library and service to deliver word-embeddings and semantic relatedness to real-world applications in the domains of machine learning and natural language processing. It offers 60+ pre-build models in 14 languages and several model algorithms and corpora.
Indra is an efficient library and service to deliver word-embeddings and semantic relatedness to real-world applications in the domains of machine learning and natural language processing. It offers 60+ pre-build models in 15 languages and several model algorithms and corpora.

Indra is powered by [spotify-annoy](https://github.com/spotify/annoy) delivering an efficient [approximate nearest neighbors](http://en.wikipedia.org/wiki/Nearest_neighbor_search#Approximate_nearest_neighbor) function.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ private void loadMappings() {

String line;
while ((line = reader.readLine()) != null) {
String[] parts = line.split(Pattern.quote("|"));
int id = Integer.parseInt(parts[0]);
this.idToWord[id] = parts[1];
this.wordToId.put(parts[1], id);
int i = line.indexOf('|');
int id = Integer.parseInt(line.substring(0, i));
this.idToWord[id] = line.substring(i + 1);
this.wordToId.put(this.idToWord[id], id);
}
} catch (IOException e) {
String msg = String.format("errors when loading mappings. BASEDIR=%s | MAPPING_GILE=%s", dataDir, WORD_MAPPING_FILE);
Expand Down

0 comments on commit 9207f28

Please sign in to comment.