Browse Source

Rename helper/query_parser to helper/text_parser

pull/347/head
Julian Simioni 9 years ago
parent
commit
59b70f7c7e
  1. 0
      helper/text_parser.js
  2. 6
      sanitiser/_text.js
  3. 2
      test/unit/helper/text_parser.js
  4. 2
      test/unit/query/autocomplete.js
  5. 2
      test/unit/query/search.js
  6. 2
      test/unit/run.js
  7. 2
      test/unit/sanitiser/search.js

0
helper/query_parser.js → helper/text_parser.js

6
sanitiser/_text.js

@ -1,5 +1,5 @@
var check = require('check-types'),
query_parser = require('../helper/query_parser');
text_parser = require('../helper/text_parser');
// validate texts, convert types and apply defaults
function sanitize( raw, clean ){
@ -19,14 +19,14 @@ function sanitize( raw, clean ){
clean.text = raw.text;
// parse text with query parser
var parsed_text = query_parser.get_parsed_address(clean.text);
var parsed_text = text_parser.get_parsed_address(clean.text);
if (check.assigned(parsed_text)) {
clean.parsed_text = parsed_text;
}
// try to set layers from query parser results
clean.types = clean.layers || {};
clean.types.from_address_parsing = query_parser.get_layers(clean.text);
clean.types.from_address_parsing = text_parser.get_layers(clean.text);
}
return messages;

2
test/unit/helper/query_parser.js → test/unit/helper/text_parser.js

@ -1,4 +1,4 @@
var parser = require('../../../helper/query_parser');
var parser = require('../../../helper/text_parser');
var type_mapping = require('../../../helper/type_mapping');
var layers_map = type_mapping.layer_with_aliases_to_type;

2
test/unit/query/autocomplete.js

@ -1,6 +1,6 @@
var generate = require('../../../query/autocomplete');
var parser = require('../../../helper/query_parser');
var parser = require('../../../helper/text_parser');
module.exports.tests = {};

2
test/unit/query/search.js

@ -1,5 +1,5 @@
var generate = require('../../../query/search');
var parser = require('../../../helper/query_parser');
var parser = require('../../../helper/text_parser');
module.exports.tests = {};

2
test/unit/run.js

@ -9,7 +9,7 @@ var tests = [
require('./helper/geojsonify'),
require('./helper/labelGenerator'),
require('./helper/labelSchema'),
require('./helper/query_parser'),
require('./helper/text_parser'),
require('./helper/type_mapping'),
require('./helper/types'),
require('./middleware/confidenceScore'),

2
test/unit/sanitiser/search.js

@ -1,6 +1,6 @@
var extend = require('extend'),
search = require('../../../sanitiser/search'),
parser = require('../../../helper/query_parser'),
parser = require('../../../helper/text_parser'),
sanitize = search.sanitize,
middleware = search.middleware,
defaultError = 'invalid param \'text\': text length, must be >0';

Loading…
Cancel
Save