Skip to content

Commit d7317f3

Browse files
committed
initial commit
0 parents  commit d7317f3

File tree

65 files changed

+14071
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+14071
-0
lines changed

.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Node.gitignore
2+
3+
# Logs
4+
logs
5+
*.log
6+
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19+
.grunt
20+
21+
# node-waf configuration
22+
.lock-wscript
23+
24+
# Compiled binary addons (http://nodejs.org/api/addons.html)
25+
build/Release
26+
27+
# Dependency directory
28+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
29+
node_modules
30+
31+
# Debug log from npm
32+
npm-debug.log
33+
34+
35+
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Global/JetBrains.gitignore
36+
37+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
38+
39+
*.iml
40+
41+
## Directory-based project format:
42+
.idea/
43+
# if you remove the above rule, at least ignore the following:
44+
45+
# User-specific stuff:
46+
# .idea/workspace.xml
47+
# .idea/tasks.xml
48+
# .idea/dictionaries
49+
50+
# Sensitive or high-churn files:
51+
# .idea/dataSources.ids
52+
# .idea/dataSources.xml
53+
# .idea/sqlDataSources.xml
54+
# .idea/dynamic.xml
55+
# .idea/uiDesigner.xml
56+
57+
# Gradle:
58+
# .idea/gradle.xml
59+
# .idea/libraries
60+
61+
# Mongo Explorer plugin:
62+
# .idea/mongoSettings.xml
63+
64+
## File-based project format:
65+
*.ipr
66+
*.iws
67+
68+
## Plugin-specific files:
69+
70+
# IntelliJ
71+
out/
72+
73+
# mpeltonen/sbt-idea plugin
74+
.idea_modules/
75+
76+
# JIRA plugin
77+
atlassian-ide-plugin.xml
78+
79+
# Crashlytics plugin (for Android Studio and IntelliJ)
80+
com_crashlytics_export_strings.xml
81+
crashlytics.properties
82+
crashlytics-build.properties
83+
84+
85+
/lib

.gitmodules

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[submodule "repo/JavaScript-Plugin-Architecture"]
2+
path = repo/JavaScript-Plugin-Architecture
3+
url = https://github.com/azu/JavaScript-Plugin-Architecture
4+
[submodule "repo/Introduction-to-Add-on-Development-in-Blender"]
5+
path = repo/Introduction-to-Add-on-Development-in-Blender
6+
url = https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender
7+
[submodule "repo/The-Little-Book-on-CoffeeScript"]
8+
path = repo/The-Little-Book-on-CoffeeScript
9+
url = https://github.com/minghai/library
10+
branch = gh-pages

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sudo: false
2+
language: node_js
3+
node_js: "stable"

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017 azu
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# technological-book-corpus-ja
2+
3+
日本語技術書のコーパス。
4+
5+
日本語の再配布が可能な技術書を集めたものです。
6+
7+
## Install
8+
9+
Install with [npm](https://www.npmjs.com/):
10+
11+
npm install technological-book-corpus-ja
12+
13+
## Usage
14+
15+
```js
16+
const References = {
17+
"JavaScript-Plugin-Architecture": {
18+
name: "JavaScript-Plugin-Architecture",
19+
url: "https://github.com/azu/JavaScript-Plugin-Architecture",
20+
license: "https://github.com/azu/JavaScript-Plugin-Architecture#license"
21+
},
22+
"Introduction-to-Add-on-Development-in-Blender": {
23+
name: "Introduction-to-Add-on-Development-in-Blender",
24+
url: "https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender",
25+
license: "https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender/blob/draft/LICENSE"
26+
},
27+
...
28+
};
29+
/**
30+
* get files by glob pattern
31+
* @param {string} patterns glob pattern
32+
* "/" root is source directory
33+
* @see https://github.com/isaacs/node-glob
34+
*/
35+
module.exports.findByPattern = function findByPattern(patterns) {};
36+
/**
37+
* get files by type
38+
* default all files
39+
* @param {string} ext
40+
* e.g) ".md"
41+
*/
42+
module.exports.get = function get(ext = ".*") {};
43+
```
44+
45+
## References
46+
47+
このコーパスは次の文書を含んでいます。
48+
それぞれの文書のライセンスに基づき再配布されています。
49+
50+
- [JavaScript-Plugin-Architecture](https://github.com/azu/JavaScript-Plugin-Architecture)
51+
- License: <https://github.com/azu/JavaScript-Plugin-Architecture#license>
52+
- [Introduction-to-Add-on-Development-in-Blender](https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender)
53+
- License: <https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender/blob/draft/LICENSE>
54+
- [The-Little-Book-on-CoffeeScript](https://github.com/minghai/library/tree/gh-pages)
55+
- License: <https://github.com/minghai/library/tree/gh-pages>
56+
57+
## Changelog
58+
59+
See [Releases page](https://github.com/textlint-ja/technological-book-corpus-ja/releases).
60+
61+
## Running tests
62+
63+
Install devDependencies and Run `npm test`:
64+
65+
npm i -d && npm test
66+
67+
## Contributing
68+
69+
Pull requests and stars are always welcome.
70+
71+
For bugs and feature requests, [please create an issue](https://github.com/textlint-ja/technological-book-corpus-ja/issues).
72+
73+
1. Fork it!
74+
2. Create your feature branch: `git checkout -b my-new-feature`
75+
3. Commit your changes: `git commit -am 'Add some feature'`
76+
4. Push to the branch: `git push origin my-new-feature`
77+
5. Submit a pull request :D
78+
79+
## Author
80+
81+
- [github/azu](https://github.com/azu)
82+
- [twitter/azu_re](https://twitter.com/azu_re)
83+
84+
## License
85+
86+
MIT © azu

build.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// MIT © 2017 azu
2+
"use strict";
3+
const cpx = require("cpx");
4+
const path = require("path");
5+
const repoDir = path.join(__dirname, "repo");
6+
const sourceDir = path.join(__dirname, "source");
7+
const fs = require("fs");
8+
const addTextToMarkdown = require("add-text-to-markdown");
9+
const Refs = require("./index").References;
10+
/**
11+
*
12+
* @param {Object} repoObject リポジトリ情報
13+
* @param {string} pattern glob pattern
14+
*/
15+
function copy(repoObject, pattern) {
16+
const repo = repoObject.name;
17+
const baseDir = path.join(repoDir, repo);
18+
return new Promise((resolve, reject) => {
19+
cpx.copy(`${baseDir}/${pattern}`, `${sourceDir}/${repo}`, {
20+
clean: true,
21+
preserve: true
22+
}, (error) => {
23+
if (error) {
24+
reject(error);
25+
} else {
26+
resolve();
27+
}
28+
});
29+
});
30+
}
31+
32+
33+
function copyTask() {
34+
return Promise.all([
35+
copy(Refs["JavaScript-Plugin-Architecture"], "ja/**/*.md"),
36+
copy(Refs["Introduction-to-Add-on-Development-in-Blender"], "body/chapter_**/*.md"),
37+
copy(Refs["The-Little-Book-on-CoffeeScript"], "coffeescript/chapters/ja_JP/**/*.md")
38+
]);
39+
}
40+
41+
function updateReference() {
42+
const README = fs.readFileSync(path.join(__dirname, "README.md"), "utf-8");
43+
const refs = Object.keys(Refs).map(key => {
44+
const repoInfo = Refs[key];
45+
return `- [${repoInfo.name}](${repoInfo.url})
46+
- License: ${repoInfo.license}`
47+
}).join("\n");
48+
const addContent = `このコーパスは次の文書を含んでいます。
49+
それぞれの文書のライセンスに基づき再配布されています。
50+
51+
${refs}`;
52+
const newContent = addTextToMarkdown(README, addContent, "References");
53+
fs.writeFileSync(path.join(__dirname, "README.md"), newContent, "utf-8");
54+
}
55+
// main
56+
copyTask();
57+
updateReference();

index.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// MIT © 2017 azu
2+
"use strict";
3+
const globby = require('globby');
4+
const path = require("path");
5+
const References = {
6+
"JavaScript-Plugin-Architecture": {
7+
name: "JavaScript-Plugin-Architecture",
8+
url: "https://github.com/azu/JavaScript-Plugin-Architecture",
9+
license: "https://github.com/azu/JavaScript-Plugin-Architecture#license"
10+
},
11+
"Introduction-to-Add-on-Development-in-Blender": {
12+
name: "Introduction-to-Add-on-Development-in-Blender",
13+
url: "https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender",
14+
license: "https://github.com/nutti/Introduction-to-Add-on-Development-in-Blender/blob/draft/LICENSE"
15+
},
16+
"The-Little-Book-on-CoffeeScript": {
17+
name: "The-Little-Book-on-CoffeeScript",
18+
url: "https://github.com/minghai/library/tree/gh-pages",
19+
license: "https://github.com/minghai/library/tree/gh-pages"
20+
}
21+
};
22+
23+
const sourceDir = path.join(__dirname, "source");
24+
/**
25+
* get files by glob pattern
26+
* @param {string} patterns glob pattern
27+
* "/" root is source directory
28+
* @see https://github.com/isaacs/node-glob
29+
*/
30+
function findByPattern(patterns) {
31+
return globby.sync(patterns, {
32+
root: sourceDir,
33+
nodir: true
34+
});
35+
}
36+
/**
37+
* get files by type
38+
* default all files
39+
* @param {string} ext
40+
* e.g) ".md"
41+
*/
42+
function get(ext = ".*") {
43+
return findByPattern(`/**/*${ext}`);
44+
}
45+
module.exports.References = References;
46+
module.exports.findByPattern = findByPattern;
47+
module.exports.get = get;

package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"directories": {
3+
"test": "test"
4+
},
5+
"author": "azu",
6+
"license": "MIT",
7+
"files": [
8+
"index.js",
9+
"bin/",
10+
"source/"
11+
],
12+
"name": "technological-book-corpus-ja",
13+
"version": "1.0.0",
14+
"description": "日本語で書かれた技術書のコーパス",
15+
"main": "lib/technological-book-corpus-ja.js",
16+
"scripts": {
17+
"build": "gulp",
18+
"update-refs": "git submodule foreach git pull",
19+
"test": "mocha"
20+
},
21+
"keywords": [
22+
"textlint",
23+
"japanese",
24+
"book",
25+
"corpus",
26+
"natural-language"
27+
],
28+
"repository": {
29+
"type": "git",
30+
"url": "https://github.com/textlint-ja/technological-book-corpus-ja.git"
31+
},
32+
"bugs": {
33+
"url": "https://github.com/textlint-ja/technological-book-corpus-ja/issues"
34+
},
35+
"homepage": "https://github.com/textlint-ja/technological-book-corpus-ja",
36+
"dependencies": {
37+
"globby": "^6.1.0"
38+
},
39+
"devDependencies": {
40+
"add-text-to-markdown": "^2.0.0",
41+
"cpx": "^1.5.0",
42+
"mocha": "^3.2.0"
43+
}
44+
}

0 commit comments

Comments
 (0)