-
Notifications
You must be signed in to change notification settings - Fork 3
/
retext-cliches.js
1589 lines (1438 loc) · 35.7 KB
/
retext-cliches.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.retextSimplify = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* @author Duncan Beaton
* @copyright 2016 Duncan Beaton
* @license MIT
* @module retext:cliches
* @fileoverview Check phrases cliches.
*/
'use strict';
/* eslint-env commonjs */
/*
* Dependencies.
*/
var difference = require('array-differ');
var nlcstToString = require('nlcst-to-string');
var quotation = require('quotation');
var search = require('nlcst-search');
var list = require('no-cliches/lib/list');
/**
* Attacher.
*
* @param {Retext} processor
* - Instance.
* @param {Object?} [options]
* - Configuration.
* @param {Array.<string>?} [options.ignore]
* - List of phrases to *not* warn about.
* @return {Function} - `transformer`.
*/
function attacher(processor, options) {
var ignore = (options || {}).ignore || [];
var phrases = difference(list, ignore);
/**
* Search `tree` for validations.
*
* @param {Node} tree - NLCST node.
* @param {VFile} file - Virtual file.
*/
function transformer(tree, file) {
search(tree, phrases, function (match, position, parent, phrase) {
var value = quotation(nlcstToString(match), '“', '”');
var message = 'Warning: ' + value + ' is a cliche';
message = file.warn(message, {
'start': match[0].position.start,
'end': match[match.length - 1].position.end
});
message.cliche = phrase;
message.source = 'retext-cliche';
});
}
return transformer;
}
/*
* Expose.
*/
module.exports = attacher;
},{"array-differ":2,"nlcst-search":3,"nlcst-to-string":7,"no-cliches/lib/list":8,"quotation":9}],2:[function(require,module,exports){
'use strict';
module.exports = function (arr) {
var rest = [].concat.apply([], [].slice.call(arguments, 1));
return arr.filter(function (el) {
return rest.indexOf(el) === -1;
});
};
},{}],3:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module nlcst:search
* @fileoverview Search for patterns in an NLCST tree.
*/
'use strict';
/* eslint-env commonjs */
/*
* Dependencies.
*/
var visit = require('unist-util-visit');
var normalize = require('nlcst-normalize');
var isLiteral = require('nlcst-is-literal');
/*
* Methods.
*/
var has = Object.prototype.hasOwnProperty;
/*
* Constants (characters).
*/
var C_SPACE = ' ';
/*
* Constants (types).
*/
var T_WORD = 'WordNode';
var T_WHITE_SPACE = 'WhiteSpaceNode';
/**
* Search.
*
* @param {Node} tree - NLCST node.
* @param {Object|Array.<string>} phrases - Phrases to
* search for. When `object`, searches for its keys.
* @param {Function} handler - Handler.
* @param {boolean} allowApostrophes - Do not strip
* apostrophes, normalize them.
*/
function search(tree, phrases, handler, allowApostrophes) {
var apos = allowApostrophes;
var byWord = {};
var length;
var index;
var key;
var firstWord;
/**
* Handle a phrase.
*
* @param {string} phrase - Phrase to search for.
*/
function handlePhrase(phrase) {
firstWord = normalize(phrase.split(C_SPACE, 1)[0], apos);
if (has.call(byWord, firstWord)) {
byWord[firstWord].push(phrase);
} else {
byWord[firstWord] = [phrase];
}
}
if (!tree || !tree.type) {
throw new Error('Expected node');
}
if (typeof phrases !== 'object') {
throw new Error('Expected object for phrases');
}
length = phrases.length;
index = -1;
if ('length' in phrases) {
while (++index < length) {
handlePhrase(phrases[index]);
}
} else {
for (key in phrases) {
handlePhrase(key);
}
}
/**
* Test a phrase.
*
* @param {string} phrase - Phrase to search for.
* @param {number} position - Position at which the
* first word of `phrase` exists.
* @param {Node} parent - Parent of `node`.
*/
function test(phrase, position, parent) {
var siblings = parent.children;
var node = siblings[position];
var count = siblings.length;
var queue = [node];
var expression = phrase.split(C_SPACE).slice(1);
var length = expression.length;
var index = -1;
/*
* Move one position forward.
*/
position++;
/*
* Iterate over `expression`.
*/
while (++index < length) {
/*
* Allow joining white-space.
*/
while (position < count) {
node = siblings[position];
if (node.type !== T_WHITE_SPACE) {
break;
}
queue.push(node);
position++;
}
node = siblings[position];
/*
* Exit if there are no nodes left, if the
* current node is not a word, or if the
* current word does not match the search for
* value.
*/
if (
!node ||
node.type !== T_WORD ||
normalize(expression[index], apos) !== normalize(node, apos)
) {
return null;
}
queue.push(node);
position++;
}
return queue;
}
/**
* Visitor for `WordNode`s.
*
* @param {Node} node - Word.
* @param {number} position - Position of `node` in
* `parent`.
* @param {Node} parent - Parent of `node`.
*/
function visitor(node, position, parent) {
var word;
var phrases;
var length;
var index;
var result;
if (isLiteral(parent, position)) {
return;
}
word = normalize(node, apos);
phrases = has.call(byWord, word) ? byWord[word] : [];
length = phrases.length;
index = -1;
while (++index < length) {
result = test(phrases[index], position, parent);
if (result) {
handler(result, position, parent, phrases[index]);
}
}
}
/*
* Search the tree.
*/
visit(tree, T_WORD, visitor);
}
/*
* Expose.
*/
module.exports = search;
},{"nlcst-is-literal":4,"nlcst-normalize":5,"unist-util-visit":6}],4:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2014-2015 Titus Wormer
* @license MIT
* @module nlcst:is-literal
* @fileoverview Check whether an NLCST node is meant literally.
*/
'use strict';
/* eslint-env commonjs */
/*
* Dependencies.
*/
var toString = require('nlcst-to-string');
/*
* Single delimiters.
*/
var single = {
'-': true, // hyphen-minus
'–': true, // en-dash
'—': true, // em-dash
':': true, // colon
';': true // semicolon
};
/*
* Pair delimiters. From common sense, and wikipedia:
* Mostly from https://en.wikipedia.org/wiki/Quotation_mark.
*/
var pairs = {
',': {
',': true
},
'-': {
'-': true
},
'–': {
'–': true
},
'—': {
'—': true
},
'"': {
'"': true
},
'\'': {
'\'': true
},
'‘': {
'’': true
},
'‚': {
'’': true
},
'’': {
'’': true,
'‚': true
},
'“': {
'”': true
},
'”': {
'”': true
},
'„': {
'”': true,
'“': true
},
'«': {
'»': true
},
'»': {
'«': true
},
'‹': {
'›': true
},
'›': {
'‹': true
},
'(': {
')': true
},
'[': {
']': true
},
'{': {
'}': true
},
'⟨': {
'⟩': true
},
'「': {
'」': true
}
}
/**
* Check whether parent contains word-nodes between
* `start` and `end`.
*
* @param {NLCSTParentNode} parent - Node with children.
* @param {number} start - Starting point (inclusive).
* @param {number} end - Ending point (exclusive).
* @return {boolean} - Whether word-nodes are found.
*/
function containsWord(parent, start, end) {
var siblings = parent.children;
var index = start - 1;
while (++index < end) {
if (siblings[index].type === 'WordNode') {
return true;
}
}
return false;
}
/**
* Check if there are word nodes before `position`
* in `parent`.
*
* @param {NLCSTParentNode} parent - Node with children.
* @param {number} position - Position before which to
* check.
* @return {boolean} - Whether word-nodes are found.
*/
function hasWordsBefore(parent, position) {
return containsWord(parent, 0, position);
}
/**
* Check if there are word nodes before `position`
* in `parent`.
*
* @param {NLCSTParentNode} parent - Node with children.
* @param {number} position - Position afyer which to
* check.
* @return {boolean} - Whether word-nodes are found.
*/
function hasWordsAfter(parent, position) {
return containsWord(parent, position + 1, parent.children.length);
}
/**
* Check if `node` is in `delimiters`.
*
* @param {Node} node - Node to check.
* @param {Object} delimiters - Map of delimiters.
* @return {(Node|boolean)?} - `false` if not, the given
* node when true, and `null` when this is a white-space
* node.
*/
function delimiterCheck(node, delimiters) {
var type = node.type;
if (type === 'WordNode' || type === 'SourceNode') {
return false;
}
if (type === 'WhiteSpaceNode') {
return null;
}
return toString(node) in delimiters ? node : false;
}
/**
* Find the next delimiter after `position` in
* `parent`. Returns the delimiter node when found.
*
* @param {NLCSTParentNode} parent - Parent to search.
* @param {number} position - Position to search after.
* @param {Object} delimiters - Map of delimiters.
* @return {Node?} - Following delimiter.
*/
function nextDelimiter(parent, position, delimiters) {
var siblings = parent.children;
var index = position;
var length = siblings.length;
var result;
while (++index < length) {
result = delimiterCheck(siblings[index], delimiters);
if (result === null) {
continue;
}
return result;
}
return null;
}
/**
* Find the previous delimiter before `position` in
* `parent`. Returns the delimiter node when found.
*
* @param {NLCSTParentNode} parent - Parent to search.
* @param {number} position - Position to search before.
* @param {Object} delimiters - Map of delimiters.
* @return {Node?} - Previous delimiter.
*/
function previousDelimiter(parent, position, delimiters) {
var siblings = parent.children;
var index = position;
var result;
while (index--) {
result = delimiterCheck(siblings[index], delimiters);
if (result === null) {
continue;
}
return result;
}
return null;
}
/**
* Check if the node in `parent` at `position` is enclosed
* by matching delimiters.
*
* @param {NLCSTParentNode} parent - Parent to search.
* @param {number} position - Position of node to check.
* @param {Object} delimiters - Map of delimiters.
* @return {boolean} - Whether the node is wrapped.
*/
function isWrapped(parent, position, delimiters) {
var prev = previousDelimiter(parent, position, delimiters);
var next;
if (prev) {
next = nextDelimiter(parent, position, delimiters[toString(prev)]);
}
return Boolean(next);
}
/**
* Check if the node in `parent` at `position` is enclosed
* by matching delimiters.
*
* For example, in:
*
* - `Foo - is meant as a literal.`;
* - `Meant as a literal is - foo.`;
* - `The word “foo” is meant as a literal.`;
*
* ...`foo` is literal.
*
* @param {NLCSTParentNode} parent - Parent to search.
* @param {number} index - Position of node to check.
* @return {boolean} - Whether the node is wrapped.
*/
function isLiteral(parent, index) {
if (!(parent && parent.children)) {
throw new Error('Parent must be a node');
}
if (isNaN(index)) {
throw new Error('Index must be a number');
}
if (
(!hasWordsBefore(parent, index) && nextDelimiter(parent, index, single)) ||
(!hasWordsAfter(parent, index) && previousDelimiter(parent, index, single)) ||
isWrapped(parent, index, pairs)
) {
return true;
}
return false;
}
/*
* Expose.
*/
module.exports = isLiteral;
},{"nlcst-to-string":7}],5:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module nlcst:normalize
* @fileoverview Normalize a word for easier comparison.
*/
'use strict';
/* eslint-env commonjs */
/*
* Dependencies.
*/
var toString = require('nlcst-to-string');
/*
* Constants.
*/
var ALL = /[-'’]/g;
var DASH = /-/g;
var APOSTROPHE = /’/g;
var QUOTE = '\'';
var EMPTY = '';
/**
* Normalize `value`.
*
* @param {string} value - Value to normalize.
* @param {boolean} allowApostrophes - Do not strip
* apostrophes.
* @return {string} - Normalized `value`.
*/
function normalize(value, allowApostrophes) {
var result = (typeof value === 'string' ? value : toString(value))
.toLowerCase();
if (allowApostrophes) {
return result
.replace(APOSTROPHE, QUOTE)
.replace(DASH, EMPTY);
}
return result.replace(ALL, EMPTY);
}
/*
* Expose.
*/
module.exports = normalize;
},{"nlcst-to-string":7}],6:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer. All rights reserved.
* @module unist:util:visit
* @fileoverview Utility to recursively walk over unist nodes.
*/
'use strict';
/**
* Walk forwards.
*
* @param {Array.<*>} values - Things to iterate over,
* forwards.
* @param {function(*, number): boolean} callback - Function
* to invoke.
* @return {boolean} - False if iteration stopped.
*/
function forwards(values, callback) {
var index = -1;
var length = values.length;
while (++index < length) {
if (callback(values[index], index) === false) {
return false;
}
}
return true;
}
/**
* Walk backwards.
*
* @param {Array.<*>} values - Things to iterate over,
* backwards.
* @param {function(*, number): boolean} callback - Function
* to invoke.
* @return {boolean} - False if iteration stopped.
*/
function backwards(values, callback) {
var index = values.length;
var length = -1;
while (--index > length) {
if (callback(values[index], index) === false) {
return false;
}
}
return true;
}
/**
* Visit.
*
* @param {Node} tree - Root node
* @param {string} [type] - Node type.
* @param {function(node): boolean?} callback - Invoked
* with each found node. Can return `false` to stop.
* @param {boolean} [reverse] - By default, `visit` will
* walk forwards, when `reverse` is `true`, `visit`
* walks backwards.
*/
function visit(tree, type, callback, reverse) {
var iterate;
var one;
var all;
if (typeof type === 'function') {
reverse = callback;
callback = type;
type = null;
}
iterate = reverse ? backwards : forwards;
/**
* Visit `children` in `parent`.
*/
all = function (children, parent) {
return iterate(children, function (child, index) {
return child && one(child, index, parent);
});
};
/**
* Visit a single node.
*/
one = function (node, index, parent) {
var result;
index = index || (parent ? 0 : null);
if (!type || node.type === type) {
result = callback(node, index, parent || null);
}
if (node.children && result !== false) {
return all(node.children, node);
}
return result;
};
one(tree);
}
/*
* Expose.
*/
module.exports = visit;
},{}],7:[function(require,module,exports){
/**
* @author Titus Wormer
* @copyright 2014-2015 Titus Wormer
* @license MIT
* @module nlcst:to-string
* @fileoverview Transform an NLCST node into a string.
*/
'use strict';
/* eslint-env commonjs */
/**
* Stringify an NLCST node.
*
* @param {NLCSTNode|Array.<NLCSTNode>} node - Node to to
* stringify.
* @param {string} separator - Value to separate each item
* with.
* @return {string} - Stringified `node`.
*/
function nlcstToString(node, separator) {
var values;
var length;
var children;
separator = separator || '';
if (typeof node.value === 'string') {
return node.value;
}
children = 'length' in node ? node : node.children;
length = children.length;
/*
* Shortcut: This is pretty common, and a small performance win.
*/
if (length === 1 && 'value' in children[0]) {
return children[0].value;
}
values = [];
while (length--) {
values[length] = nlcstToString(children[length], separator);
}
return values.join(separator);
}
/*
* Expose.
*/
module.exports = nlcstToString;
},{}],8:[function(require,module,exports){
module.exports = [
'a chip off the old block',
'a clean slate',
'a dark and stormy night',
'a far cry',
'a fine kettle of fish',
'a loose cannon',
'a penny saved is a penny earned',
'a tough row to hoe',
'a word to the wise',
'ace in the hole',
'acid test',
'add insult to injury',
'against all odds',
'air your dirty laundry',
'all fun and games',
'all in a day\'s work',
'all talk, no action',
'all thumbs',
'all your eggs in one basket',
'all\'s fair in love and war',
'all\'s well that ends well',
'almighty dollar',
'American as apple pie',
'an axe to grind',
'another day, another dollar',
'armed to the teeth',
'as luck would have it',
'as old as time',
'as the crow flies',
'at loose ends',
'at my wits end',
'avoid like the plague',
'babe in the woods',
'back against the wall',
'back in the saddle',
'back to square one',
'back to the drawing board',
'bad to the bone',
'badge of honor',
'bald faced liar',
'ballpark figure',
'banging your head against a brick wall',
'baptism by fire',
'barking up the wrong tree',
'bat out of hell',
'be all and end all',
'beat a dead horse',
'beat around the bush',
'been there, done that',
'beggars can\'t be choosers',
'behind the eight ball',
'bend over backwards',
'benefit of the doubt',
'bent out of shape',
'best thing since sliced bread',
'bet your bottom dollar',
'better half',
'better late than never',
'better mousetrap',
'better safe than sorry',
'between a rock and a hard place',
'beyond the pale',
'bide your time',
'big as life',
'big cheese',
'big fish in a small pond',
'big man on campus',
'bigger they are the harder they fall',
'bird in the hand',
'bird\'s eye view',
'birds and the bees',
'birds of a feather flock together',
'bit the hand that feeds you',
'bite the bullet',
'bite the dust',
'bitten off more than he can chew',
'black as coal',
'black as pitch',
'black as the ace of spades',
'blast from the past',
'bleeding heart',
'blessing in disguise',
'blind ambition',
'blind as a bat',
'blind leading the blind',
'blood is thicker than water',
'blood sweat and tears',
'blow off steam',
'blow your own horn',
'blushing bride',
'boils down to',
'bolt from the blue',
'bone to pick',
'bored stiff',
'bored to tears',
'bottomless pit',
'boys will be boys',
'bright and early',
'brings home the bacon',
'broad across the beam',
'broken record',
'brought back to reality',
'bull by the horns',
'bull in a china shop',
'burn the midnight oil',
'burning question',
'burning the candle at both ends',
'burst your bubble',
'bury the hatchet',
'busy as a bee',
'by hook or by crook',
'call a spade a spade',
'called onto the carpet',
'calm before the storm',
'can of worms',
'can\'t cut the mustard',
'can\'t hold a candle to',
'case of mistaken identity',
'cat got your tongue',
'cat\'s meow',
'caught in the crossfire',
'caught red-handed',
'checkered past',
'chomping at the bit',
'cleanliness is next to godliness',
'clear as a bell',
'clear as mud',
'close to the vest',
'cock and bull story',
'cold shoulder',
'come hell or high water',
'cool as a cucumber',
'cool, calm, and collected',
'cost a king\'s ransom',
'count your blessings',
'crack of dawn',
'crash course',
'creature comforts',
'cross that bridge when you come to it',
'crushing blow',
'cry like a baby',
'cry me a river',
'cry over spilt milk',
'crystal clear',
'curiosity killed the cat',
'cut and dried',
'cut through the red tape',
'cut to the chase',
'cute as a bugs ear',
'cute as a button',
'cute as a puppy',
'cuts to the quick',
'dark before the dawn',
'day in, day out',
'dead as a doornail',
'devil is in the details',
'dime a dozen',
'divide and conquer',
'dog and pony show',
'dog days',
'dog eat dog',
'dog tired',
'don\'t burn your bridges',
'don\'t count your chickens',
'don\'t look a gift horse in the mouth',
'don\'t rock the boat',
'don\'t step on anyone\'s toes',
'don\'t take any wooden nickels',
'down and out',
'down at the heels',
'down in the dumps',
'down the hatch',
'down to earth',
'draw the line',
'dressed to kill',
'dressed to the nines',
'drives me up the wall',
'dull as dishwater',
'dyed in the wool',
'eagle eye',
'ear to the ground',
'early bird catches the worm',
'easier said than done',
'easy as pie',
'eat your heart out',
'eat your words',
'eleventh hour',
'even the playing field',
'every dog has its day',
'every fiber of my being',
'everything but the kitchen sink',
'eye for an eye',