diff options
| author | Alon Levy <alon@pobox.com> | 2015-01-27 16:11:05 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-01-27 16:11:05 +0200 |
| commit | b0078d34e8c074db33cf01abbd9bd55a2bf45bbc (patch) | |
| tree | fcce27c5399eec96836bb0336964951a9c85f8ba /src/client/textanalysis.js | |
| parent | 4db8cf6cafdd931061c6f41306cfccc9f58ddc4b (diff) | |
client: remove whitespace around tokens: Fixes #292
Diffstat (limited to 'src/client/textanalysis.js')
| -rw-r--r-- | src/client/textanalysis.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 138425a5..e0b57dbc 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -101,6 +101,8 @@ function tokenize(text, node_token, quote) prev_whitespace = prev === null || prev === ' ' || prev === '\t'; } next(); + // Remove whitespace around tokens. Can be done with lookahead but less code this way + tokens.forEach(function (obj) { obj.token = obj.token.trim(); }); return tokens; } |
