Skip to content

Commit 522ce6e

Browse files
committed
Add Open Office words.
1 parent c53cc28 commit 522ce6e

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
[moby-thesaurus.org](http://moby-thesaurus.org) is a free and
44
open-source website designed to facilitate meanderings through the [Moby
55
Thesaurus](http://en.wikipedia.org/wiki/Moby_Project#Thesaurus), the largest
6-
thesaurus in the English language.
6+
thesaurus in the English language. As of version 1.0, this package also includes
7+
synonym data from the [Open Office thesaurus](http://goo.gl/UGBfHI).
78

89
This git repository is many things:
910

1011
- The source code for the [moby-thesaurus.org](http://moby-thesaurus.org/) website.
11-
- A tiny and simple JavaScript interface for querying Moby Thesaurus data.
12-
- A command-line interface (CLI) for searching a local, cached copy of moby from the terminal.
12+
- A tiny and simple JavaScript interface for querying Moby Thesaurus and Open Office Thesaurus data.
13+
- A command-line interface (CLI) for searching a local, cached copy of the thesaurus from the terminal.
1314
- A module on npm called [moby](https://www.npmjs.org/package/moby).
1415
- Rad.
1516

@@ -48,9 +49,7 @@ Then in your javascript code:
4849
var moby = require('moby')
4950

5051
console.log(moby.search('mad'))
51-
5252
console.log(moby.search('smaragdine'))
53-
5453
console.log(moby.reverseSearch('smaragdine'))
5554
```
5655

@@ -62,3 +61,7 @@ The Moby lexicon project is complete and has been placed into the public domain.
6261
Use, sell, rework, excerpt and use in any way on any platform. Placing this
6362
material on internal or public servers is also encouraged. The compiler is not
6463
aware of any export restrictions so freely distribute world-wide.
64+
65+
See also the Open Office license included in the
66+
[thesaurus](https://github.com/daizoru/node-thesaurus/blob/5cadf8d26ea879a6009702524970ce706f04bb99/LICENSE.txt)
67+
package.

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env node
22

33
var fs = require("fs")
4+
var thesaurus = require("thesaurus")
5+
var union = require("lodash.union")
46
var words = {}
57
var firstWordRegex = new RegExp(/^([\w\-]+),/)
68
var moby = module.exports = {}
@@ -18,7 +20,10 @@ moby.search = function(term) {
1820
if (!term) return []
1921
var result = words[term]
2022
if (!result) result = words[term.toLowerCase()]
21-
return result ? result.split(",") : []
23+
if (!result) return []
24+
result = result.split(",")
25+
result = union(result, thesaurus.find(term))
26+
return result
2227
}
2328

2429
moby.reverseSearch = function(term) {

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moby",
3-
"version": "0.3.2",
3+
"version": "1.0.0",
44
"description": "A free and open-source website (and CLI) for searching the largest thesaurus in the English language.",
55
"main": "index.js",
66
"bin": "index.js",
@@ -35,6 +35,8 @@
3535
"dependencies": {
3636
"express": "^4.1.0",
3737
"jade": "^1.3.1",
38-
"marked": "^0.3.2"
38+
"lodash.union": "^2.4.1",
39+
"marked": "^0.3.2",
40+
"thesaurus": "0.0.0"
3941
}
4042
}

0 commit comments

Comments
 (0)