Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Update READMEs and ignores for new node chages
Browse files Browse the repository at this point in the history
  • Loading branch information
mzsanford committed Mar 3, 2014
1 parent b869258 commit 6054d06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ libtool
# Ports (node)
ports/node/build
ports/node/node_modules
ports/node/cld.node

# Ports (python)
ports/python/testData.pyc
Expand Down
15 changes: 9 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,22 @@ includes even more examples.

### Prerequisites

The `libcld` C++ library must be installed (see above)
The `libcld` C++ library must be installed (see above). Tested with node version `10.0.26`.

### Installing

# 'npm install ...' in the near future
$ cd /PATH/FOR/CLD
$ git clone http://github.com/mzsanford/cld.git
$ cd cld/ports/node
$ node-waf configure build
$ npm install
$ make -f Makefile.example test
$ cd PATH/FOR/YOUR/PROJECT
$ npm install /PATH/FOR/CLD/cld/ports/node

### Example

var LanguageDetector = require('languagedetector').LanguageDetector;
Assuming you're in `/PATH/FOR/YOUR/PROJECT` above:

var LanguageDetector = require("cld/cld.node").LanguageDetector;
var detector = new LanguageDetector();

// Sync - Returns two letter language code of the most likely candidate language
Expand Down Expand Up @@ -117,7 +120,7 @@ Both the `detectSync` and `detect` methods take an option second parameter that
detector.detectSync(ambig) #=> "zh-TW"
detector.detectSync(ambig, { tld: "cn" }) #=> "zh"
detector.detectSync(ambig, { tld: "jp" }) #=> "ja"

* `html` (`false`): The string to be processed HTML. If this is the case then markup will be ignored in the calculations.

* `allowExtendedLanguages` (`true`): Return language from outside of the core set of supported languages (where wuality is not as good)
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,22 @@ includes even more examples.

### Prerequisites

The `libcld` C++ library must be installed (see above)
The `libcld` C++ library must be installed (see above). Tested with node version `10.0.26`.

### Installing

# 'npm install ...' in the near future
$ cd /PATH/FOR/CLD
$ git clone http://github.com/mzsanford/cld.git
$ cd cld/ports/node
$ node-waf configure build
$ npm install
$ make -f Makefile.example test
$ cd PATH/FOR/YOUR/PROJECT
$ npm install /PATH/FOR/CLD/cld/ports/node

### Example

var LanguageDetector = require('languagedetector').LanguageDetector;
Assuming you're in `/PATH/FOR/YOUR/PROJECT` above:

var LanguageDetector = require("cld/cld.node").LanguageDetector;
var detector = new LanguageDetector();

// Sync - Returns two letter language code of the most likely candidate language
Expand Down Expand Up @@ -117,7 +120,7 @@ Both the `detectSync` and `detect` methods take an option second parameter that
detector.detectSync(ambig) #=> "zh-TW"
detector.detectSync(ambig, { tld: "cn" }) #=> "zh"
detector.detectSync(ambig, { tld: "jp" }) #=> "ja"

* `html` (`false`): The string to be processed HTML. If this is the case then markup will be ignored in the calculations.

* `allowExtendedLanguages` (`true`): Return language from outside of the core set of supported languages (where wuality is not as good)
Expand Down

0 comments on commit 6054d06

Please sign in to comment.