From ee7c95e41003b7426c4bb523898d66cdbf25d305 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 4 Sep 2015 08:33:21 +0200 Subject: [PATCH] Add `bitching`, `moaning`, `manned`, `unmanned` Closes wooorm/alex#17. --- lib/patterns.json | 87 +++++++++++++++++++++++++++++++++++------- retext-equality.js | 87 +++++++++++++++++++++++++++++++++++------- retext-equality.min.js | 2 +- script/gender.yml | 27 +++++++++++++ test.js | 16 ++++++++ 5 files changed, 192 insertions(+), 27 deletions(-) diff --git a/lib/patterns.json b/lib/patterns.json index 1fbbfbd..3c063bc 100644 --- a/lib/patterns.json +++ b/lib/patterns.json @@ -3262,6 +3262,67 @@ ], "id": 203 }, + { + "type": "simple", + "considerate": { + "staffed": "a", + "crewed": "a", + "pilotted": "a" + }, + "inconsiderate": { + "manned": "a" + }, + "categories": [ + "a" + ], + "id": 204 + }, + { + "type": "simple", + "considerate": { + "robotic": "a", + "automated": "a" + }, + "inconsiderate": { + "unmanned": "a" + }, + "categories": [ + "a" + ], + "id": 205 + }, + { + "type": "simple", + "considerate": { + "whining": "a", + "complaining": "a", + "crying": "a" + }, + "inconsiderate": { + "bitching": "a", + "moaning": "a" + }, + "categories": [ + "a" + ], + "id": 206 + }, + { + "type": "simple", + "considerate": { + "whine": "a", + "complain": "a", + "cry": "a" + }, + "inconsiderate": { + "bitch": "a", + "moan": "a" + }, + "categories": [ + "a" + ], + "id": 207 + }, { "type": "simple", "considerate": { @@ -3273,7 +3334,7 @@ "categories": [ "a" ], - "id": 204 + "id": 208 }, { "type": "simple", @@ -3286,7 +3347,7 @@ "categories": [ "a" ], - "id": 205 + "id": 209 }, { "type": "simple", @@ -3310,7 +3371,7 @@ "categories": [ "a" ], - "id": 206 + "id": 210 }, { "type": "simple", @@ -3327,7 +3388,7 @@ "categories": [ "a" ], - "id": 207 + "id": 211 }, { "type": "simple", @@ -3340,7 +3401,7 @@ "categories": [ "a" ], - "id": 208 + "id": 212 }, { "type": "simple", @@ -3353,7 +3414,7 @@ "categories": [ "a" ], - "id": 209 + "id": 213 }, { "type": "simple", @@ -3366,7 +3427,7 @@ "categories": [ "a" ], - "id": 210 + "id": 214 }, { "type": "simple", @@ -3379,7 +3440,7 @@ "categories": [ "a" ], - "id": 211 + "id": 215 }, { "type": "simple", @@ -3392,7 +3453,7 @@ "categories": [ "a" ], - "id": 212 + "id": 216 }, { "type": "simple", @@ -3405,7 +3466,7 @@ "categories": [ "a" ], - "id": 213 + "id": 217 }, { "type": "simple", @@ -3418,7 +3479,7 @@ "categories": [ "a" ], - "id": 214 + "id": 218 }, { "type": "simple", @@ -3434,7 +3495,7 @@ "categories": [ "a" ], - "id": 215 + "id": 219 }, { "type": "and", @@ -3454,6 +3515,6 @@ "a", "b" ], - "id": 216 + "id": 220 } ] diff --git a/retext-equality.js b/retext-equality.js index d7325c8..0eb5c95 100644 --- a/retext-equality.js +++ b/retext-equality.js @@ -3842,6 +3842,67 @@ module.exports=[ ], "id": 203 }, + { + "type": "simple", + "considerate": { + "staffed": "a", + "crewed": "a", + "pilotted": "a" + }, + "inconsiderate": { + "manned": "a" + }, + "categories": [ + "a" + ], + "id": 204 + }, + { + "type": "simple", + "considerate": { + "robotic": "a", + "automated": "a" + }, + "inconsiderate": { + "unmanned": "a" + }, + "categories": [ + "a" + ], + "id": 205 + }, + { + "type": "simple", + "considerate": { + "whining": "a", + "complaining": "a", + "crying": "a" + }, + "inconsiderate": { + "bitching": "a", + "moaning": "a" + }, + "categories": [ + "a" + ], + "id": 206 + }, + { + "type": "simple", + "considerate": { + "whine": "a", + "complain": "a", + "cry": "a" + }, + "inconsiderate": { + "bitch": "a", + "moan": "a" + }, + "categories": [ + "a" + ], + "id": 207 + }, { "type": "simple", "considerate": { @@ -3853,7 +3914,7 @@ module.exports=[ "categories": [ "a" ], - "id": 204 + "id": 208 }, { "type": "simple", @@ -3866,7 +3927,7 @@ module.exports=[ "categories": [ "a" ], - "id": 205 + "id": 209 }, { "type": "simple", @@ -3890,7 +3951,7 @@ module.exports=[ "categories": [ "a" ], - "id": 206 + "id": 210 }, { "type": "simple", @@ -3907,7 +3968,7 @@ module.exports=[ "categories": [ "a" ], - "id": 207 + "id": 211 }, { "type": "simple", @@ -3920,7 +3981,7 @@ module.exports=[ "categories": [ "a" ], - "id": 208 + "id": 212 }, { "type": "simple", @@ -3933,7 +3994,7 @@ module.exports=[ "categories": [ "a" ], - "id": 209 + "id": 213 }, { "type": "simple", @@ -3946,7 +4007,7 @@ module.exports=[ "categories": [ "a" ], - "id": 210 + "id": 214 }, { "type": "simple", @@ -3959,7 +4020,7 @@ module.exports=[ "categories": [ "a" ], - "id": 211 + "id": 215 }, { "type": "simple", @@ -3972,7 +4033,7 @@ module.exports=[ "categories": [ "a" ], - "id": 212 + "id": 216 }, { "type": "simple", @@ -3985,7 +4046,7 @@ module.exports=[ "categories": [ "a" ], - "id": 213 + "id": 217 }, { "type": "simple", @@ -3998,7 +4059,7 @@ module.exports=[ "categories": [ "a" ], - "id": 214 + "id": 218 }, { "type": "simple", @@ -4014,7 +4075,7 @@ module.exports=[ "categories": [ "a" ], - "id": 215 + "id": 219 }, { "type": "and", @@ -4034,7 +4095,7 @@ module.exports=[ "a", "b" ], - "id": 216 + "id": 220 } ] diff --git a/retext-equality.min.js b/retext-equality.min.js index 237ade9..ed77342 100644 --- a/retext-equality.min.js +++ b/retext-equality.min.js @@ -1 +1 @@ -!function(b,a){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define([],b):(typeof window!=='undefined'?a=window:typeof global!=='undefined'?a=global:typeof self!=='undefined'?a=self:a=this,a.retextEquality=b())}(function(){return function a(b,c,e){function f(d,k){if(!c[d]){if(!b[d]){var i=typeof require=='function'&&require;if(!k&&i)return i(d,!0);if(g)return g(d,!0);var j=new Error("Cannot find module '"+d+"'");throw j.code='MODULE_NOT_FOUND',j}var h=c[d]={exports:{}};b[d][0].call(h.exports,function(c){var a=b[d][1][c];return f(a?a:c)},h,h.exports,a,b,c,e)}return c[d].exports}var g=typeof require=='function'&&require;for(var d=0;d0&&!b.call(d,0))for(var i=0;i0)for(var m=0;m=0&&a.call(c.callee)==='[object Function]'),d}},{}],8:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++ac)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}]},{},[1])(1)}) +!function(b,a){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define([],b):(typeof window!=='undefined'?a=window:typeof global!=='undefined'?a=global:typeof self!=='undefined'?a=self:a=this,a.retextEquality=b())}(function(){return function a(b,c,e){function f(d,k){if(!c[d]){if(!b[d]){var i=typeof require=='function'&&require;if(!k&&i)return i(d,!0);if(g)return g(d,!0);var j=new Error("Cannot find module '"+d+"'");throw j.code='MODULE_NOT_FOUND',j}var h=c[d]={exports:{}};b[d][0].call(h.exports,function(c){var a=b[d][1][c];return f(a?a:c)},h,h.exports,a,b,c,e)}return c[d].exports}var g=typeof require=='function'&&require;for(var d=0;d0&&!b.call(d,0))for(var i=0;i0)for(var m=0;m=0&&a.call(c.callee)==='[object Function]'),d}},{}],8:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++ac)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}]},{},[1])(1)}) diff --git a/script/gender.yml b/script/gender.yml index 5745969..6df99ee 100644 --- a/script/gender.yml +++ b/script/gender.yml @@ -1454,3 +1454,30 @@ inconsiderate: manhour: male man hour: male +- type: simple + considerate: + - staffed + - crewed + - pilotted + inconsiderate: manned +- type: simple + considerate: + - robotic + - automated + inconsiderate: unmanned +- type: simple + considerate: + - whining + - complaining + - crying + inconsiderate: + - bitching + - moaning +- type: simple + considerate: + - whine + - complain + - cry + inconsiderate: + - bitch + - moan diff --git a/test.js b/test.js index a7ebfc7..88da744 100644 --- a/test.js +++ b/test.js @@ -151,6 +151,22 @@ describe('Phrasing', function () { '1:8-1:11: `him` may be insensitive, use `their`, `theirs`, `them` instead' ]); }); + + it('Manned spacecraft', function () { + var messages = process('Manned spacecraft.'); + + dequal(messages, [ + '1:1-1:7: `Manned` may be insensitive, use `Staffed`, `Crewed`, `Pilotted` instead' + ]); + }); + + it('Moaning, like wormen are always doing', function () { + var messages = process('Moaning, like wormen are always doing.'); + + dequal(messages, [ + '1:1-1:8: `Moaning` may be insensitive, use `Whining`, `Complaining`, `Crying` instead' + ]); + }); }); describe('Should NOT warn', function () {