0.0.3 • Published 9 years ago

synonymizer v0.0.3

Weekly downloads
3
License
BSD-2-Clause
Repository
github
Last release
9 years ago

Build Status

Synonymizer

Simple Synonymize Engine for Node.js Based on Solr/ElasticSearch Synonyms Format.

Installation

npm install synonymizer

Usage

synonyms.txt

APC,A.P.C,アー・ペー・セー,아페세
...

yourApp.js

var Synonymizer = require('synonymizer');
var synonymizer = new Synonymizer('./synonyms.txt');
var synonymizeWords = synonymizer.synonymize('アー・ペー・セー Jean');
console.log(synonymizeWords); //print 'APC Jean'

API

new Synonymizer(synonymFilePath)

Returns an new instance of Synonymizer.

synonymizer.synonymize(inputString)

  • inputString: The string for syonymize.

Returns string replaced by synonyms.