Commit 109b99c3 authored by Ludan Stoecklé's avatar Ludan Stoecklé

1.5.0

parent 1cd65e19
{
"name": "english-determiners",
"version": "2.4.1",
"version": "2.5.0",
"description": "English determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-adjectives",
"version": "2.4.1",
"version": "2.5.0",
"description": "Agreement of adjectives in French",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,7 +45,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.4.1"
"french-h-muet-aspire": "2.5.0"
},
"keywords": [
"french",
......
{
"name": "french-determiners",
"version": "2.4.1",
"version": "2.5.0",
"description": "French determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-h-muet-aspire",
"version": "2.4.1",
"version": "2.5.0",
"description": "List of French words that are \"aspiré\" (vs. \"muet\")\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[Dstarting with a h that is \"aspiré\" vs \"muet\"",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-ordinals",
"version": "2.4.1",
"version": "2.5.0",
"description": "Ordinal numbers in French: 12 => douzième",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-verbs",
"version": "2.4.1",
"version": "2.5.0",
"description": "French verbs: conjugation, based on the Lefff contents, and list of transitive and intransitive verbs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -50,7 +50,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.4.1"
"french-h-muet-aspire": "2.5.0"
},
"devDependencies": {
"copyfiles": "^2.1.1",
......
{
"name": "french-words-gender",
"version": "2.4.1",
"version": "2.5.0",
"description": "Gender of French words, based on the Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-adjectives",
"version": "2.4.1",
"version": "2.5.0",
"description": "German adjectives, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-determiners",
"version": "2.4.1",
"version": "2.5.0",
"description": "German determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-dict-helper",
"version": "2.4.1",
"version": "2.5.0",
"description": "Helper functions on an included database derived from german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-ordinals",
"version": "2.4.1",
"version": "2.5.0",
"description": "Ordinal numbers in German: 12 => zwölfte",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
......@@ -112,7 +112,8 @@ export function getReflexiveFormPronoun(pronominalCase: PronominalCase, person:
if (
number === 'S' &&
(person === 1 || person === 2) &&
(pronominalCase != 'ACCUSATIVE' && pronominalCase != 'DATIVE')
pronominalCase != 'ACCUSATIVE' &&
pronominalCase != 'DATIVE'
) {
const err = new Error();
err.name = 'InvalidArgumentError';
......
{
"name": "german-verbs",
"version": "2.4.1",
"version": "2.5.0",
"description": "German verbs, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"compilerOptions": {
"target": "es6",
"lib": [
"es7"
],
"module": "commonjs",
"typeRoots": [
"../../node_modules/@types"
......
{
"name": "german-words",
"version": "2.4.1",
"version": "2.5.0",
"description": "Gender and case of German words, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "gulp-rosaenlg",
"version": "2.4.1",
"version": "2.5.0",
"description": "RosaeNLG client side packaging helper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -60,6 +60,6 @@
"browserify": "^16.5.0",
"debug": "^4.1.1",
"minify-stream": "^1.2.1",
"rosaenlg": "1.4.1"
"rosaenlg": "1.5.0"
}
}
{
"name": "italian-adjectives",
"version": "2.4.1",
"version": "2.5.0",
"description": "Italian adjectives, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -58,6 +58,6 @@
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"rosaenlg-filter": "2.4.1"
"rosaenlg-filter": "2.5.0"
}
}
{
"name": "italian-determiners",
"version": "2.4.1",
"version": "2.5.0",
"description": "Italian determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-ordinals-cardinals",
"version": "2.4.1",
"version": "2.5.0",
"description": "Ordinal and cardinal numbers in Italian",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-verbs",
"version": "2.4.1",
"version": "2.5.0",
"description": "Italian verbs, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"compilerOptions": {
"target": "es6",
"lib": [
"es7"
],
"module": "commonjs",
"typeRoots": [
"../../node_modules/@types"
......
{
"name": "italian-words",
"version": "2.4.1",
"version": "2.5.0",
"description": "Gender and plural of Italian words, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "lefff-helper",
"version": "2.4.1",
"version": "2.5.0",
"description": "Helper functions on an included database derived from Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "morph-it-helper",
"version": "2.4.1",
"version": "2.5.0",
"description": "Helper functions on an included database derived from morph-it (Free Morphological Lexicon for the Italian Language)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
node_modules
coverage
cov-pt*
test/temp
sandbox/*.html
sandbox/*.js
test/
doc/
node_modules/
sandbox/*.js
# Change Log
As with most npm modules, this project adheres to [Semantic Versioning](http://semver.org/).
## KEPT FOR HISTORICAL PURPOSES. SEE ROSAENLG'S MAIN CHANGELOG.
## [1.4.0] 07/11/2019
## Changed
- Doc reorganized
- Switched to RosaeNLG 1.4.0
## [1.3.3] 06/11/2019
## Added
- Ability to generate JSON packages
## Changed
- Switched to RosaeNLG 1.3.3
- Version name is aligned, also 1.3.3
## [0.0.1] 26/05/2019
### Added
- First release after fork
- All RosaeNLG's stuff
## [1.0.0-alpha6] - 2016-06-01
### Added
- `--basedir` option is added for easier specification of that Pug option.
- Node.js v6 is now tested.
## [1.0.0-alpha5] - 2016-05-18
### Changed
- Files ending `.jade` are now recognized as Pug templates when a directory is provided as input.
## [1.0.0-alpha4] - 2016-05-18
### Changed
- When `--watch` is specified, `watch` is no longer passed as an option to Pug. This should have no effect on users.
### Fixed
- Fixed `--no-debug` option ([#23])
## [1.0.0-alpha3] - 2016-05-18
### Added
- Node.js module as option file is supported as well.
- Some examples have been added to the documentation on how to use `-O`.
## [1.0.0-alpha2] - 2016-05-18
### Changed
- Pug has been updated to the latest alpha.
- Unused dependencies have been removed.
## [1.0.0-alpha1] - 2016-03-23
### Removed
- `-H` option, deprecated in 0.1.0, has been removed.
- Support for `SIGINT` as signal for EOF, deprecated in 0.1.1, has been removed.
### Changed
- The package is renamed to `pug-cli`.
### Fixed
- Support for Windows has been fixed.
## [0.1.1] - 2015-09-29
### Deprecated
- Using `SIGINT` (`^C`) to signify end of input in standard input mode is deprecated, and will be removed in 1.0.0. Instead, use `^D` which means "end of file."
### Fixed
- Fallback on options specified with `-O` if the corresponding CLI option is not specified.
- Mark this module as preferred to be installed globally.
- Fix copyright and update maintainers in package.json.
- Fix links in HISTORY.md.
- Fix compiling directories whose paths contain backslashes (`\`) (#11).
## [0.1.0] - 2015-07-24
### Added
- Silent mode (`-s`, `--silent`) which disables printing unimportant messages (#3, pugjs/pug#1905).
### Changed
- Hierarchy mode (`-H`, `--hierarchy`) is made the default.
- Both versions of Pug and the CLI are printed with `-V` or `--version`.
- Unescaped Unicode line and paragraph separators (`U+2028` and `U+2029`) is now allowed in the `-O` option only when the input is considered to be JSON (#5, pugjs/pug#1949).
- Non-JSON object files are allowed for the `-O` option as long as it can be parsed with the `eval()` function.
### Deprecated
- Since the hierarchy mode (`-H`, `--hierarchy`) is made the default, the
option is now redundant and will be removed in 1.0.0.
### Fixed
- Capitalization in help message is kept consistent.
- Fix grammar error in the help message (by @didoarellano).
- Fix watch mode in more than one level of dependency hierarchy (pugjs/pug#1888).
## 0.0.1 - 2015-06-02
### Added
- Initial release.
[unreleased]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha5...master
[1.0.0-alpha5]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha4...1.0.0-alpha5
[1.0.0-alpha4]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha3...1.0.0-alpha4
[1.0.0-alpha3]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha2...1.0.0-alpha3
[1.0.0-alpha2]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha1...1.0.0-alpha2
[1.0.0-alpha1]: https://github.com/pugjs/pug-cli/compare/0.1.1...1.0.0-alpha1
[0.1.1]: https://github.com/pugjs/pug-cli/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/pugjs/pug-cli/compare/0.0.1...0.1.0
[#23]: https://github.com/pugjs/pug-cli/issues/23
Copyright (c) 2019 Ludan Stoecklé
Copyright (c) 2010-2014 TJ Holowaychuk
Copyright (c) 2013-2015 Forbes Lindesay
Copyright (c) 2015 Tiancheng "Timothy" Gu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# RosaeNLG Command Line Interface
CLI interface for RosaeNLG.
For documentation, see [RosaeNLG documentation](https://rosaenlg.org).
#!/usr/bin/env node
'use strict';
const fs = require('fs');
const path = require('path');
const program = require('commander');
const mkdirp = require('mkdirp');
const chalk = require('chalk');
const rosaenlg = require('rosaenlg');
const gulpRosaenlg = require('gulp-rosaenlg');
const basename = path.basename;
const dirname = path.dirname;
const resolve = path.resolve;
const normalize = path.normalize;
const relative = path.relative;
// Pug options
// hum those are all global variables
let options = {};
let consoleLog;
let render; // function for rendering
const watchList = {};
/*
renderFile -> watchFile
tryRender -> renderFile
watchFile -> tryRender
*/
/**
* Convert error to string
*/
function errorToString(e) {
return e.stack || /* istanbul ignore next */ e.message || e;
}
/**
* Generate a JSON package
*/
function generateJsonPackage() {
console.log('generating a json package...');
if (!options.packageopts) {
const err = new Error();
err.name = 'InvalidArgumentError';
err.message = `-po --packageopts is mandatory when using -jsonp --jsonpackage`;
throw err;
}
const packageopts = JSON.parse(fs.readFileSync(path.resolve(options.packageopts)), 'utf8');
// console.log(packageopts);
const packagedTemplate = gulpRosaenlg.packageTemplateJson(packageopts);
// console.log(packagedTemplate);
const output = JSON.stringify(packagedTemplate);
// console.log(program.out);
if (program.out) {
fs.writeFileSync(program.out, output, 'utf8');
} else {
process.stdout.write(output);
}
}
/**
* Compile from stdin.
*/
function stdin() {
//console.log('IN STDIN');
//console.log(options);
let buf = '';
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
buf += chunk;
});
process.stdin
.on('end', function() {
let output;
if (options.client) {
output = rosaenlg.compileClient(buf, options);
} else {
output = rosaenlg.render(buf, options);
}
process.stdout.write(output);
})
.resume();
}
/**
* Get a sensible name for a template function from a file path
*
* @param {String} filename
* @returns {String}
*/
function getNameFromFileName(filename) {
const file = basename(filename).replace(/\.(?:pug|jade)$/, '');
return (
file.toLowerCase().replace(/[^a-z0-9]+([a-z])/g, function(_, character) {
return character.toUpperCase();
}) + 'Template'
);
}
/**
* Process the given path, compiling the pug files found.
* Always walk the subdirectories.
*
* @param path path of the file, might be relative
* @param rootPath path relative to the directory specified in the command
*/
function renderFile(path, rootPath) {
//console.log('IN RENDER FILE');
//console.log(options);
if (options.yseop) {
if (!options.string) {
// either string, or provide a path
options.yseopPath = program.out;
}
}
const isPug = /\.(?:pug|jade)$/;
const isIgnored = /([\/\\]_)|(^_)/;
const stat = fs.lstatSync(path);
// Found pug file
if (stat.isFile() && isPug.test(path) && !isIgnored.test(path)) {
// Try to watch the file if needed. watchFile takes care of duplicates.
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (program.watch) watchFile(path, null, rootPath);
if (program.nameAfterFile) {
// Ludan: seems to be defined nowhere
options.name = getNameFromFileName(path);
}
const fn = options.client ? rosaenlg.compileFileClient(path, options) : rosaenlg.compileFile(path, options);
if (program.watch && fn.dependencies) {
// watch dependencies, and recompile the base
fn.dependencies.forEach(function(dep) {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
watchFile(dep, path, rootPath);
});
}