Skip to content

Commit

Permalink
enabled passing one alignment at a time to map
Browse files Browse the repository at this point in the history
  • Loading branch information
da1nerd committed Nov 21, 2018
1 parent 2fbec1f commit c974401
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordmap",
"version": "0.4.2",
"version": "0.4.3",
"description": "Multi-Lingual Word Alignment Prediction",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
12 changes: 10 additions & 2 deletions src/WordMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ export default class WordMap {
this.engine.addCorpus(sourceTokens, targetTokens);
}

public appendAlignmentMemory(alignments: Alignment[]) {
this.engine.addAlignmentMemory(alignments);
/**
* Appends alignment memory engine.
* @param alignments - an alignment or array of alignments
*/
public appendAlignmentMemory(alignments: Alignment | Alignment[]) {
if (alignments instanceof Array) {
this.engine.addAlignmentMemory(alignments);
} else {
this.engine.addAlignmentMemory([alignments]);
}
}

/**
Expand Down

0 comments on commit c974401

Please sign in to comment.