forked from neilgupta/Sherlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwatson.js
42 lines (32 loc) · 931 Bytes
/
watson.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
/**
* Watson - Collects data for Sherlock to analyze.
* Copyright (c) 2014 Tabule, Inc.
*/
var Watson = (function() {
var helpers = {
// Place your helper functions here...
};
return {
/*
* Takes the untouched input string, returns
* an array with the modified input string at position 0 and a new Sherlocked object at position 1
*/
preprocess: function(str) {
var Sherlocked = {};
// Manipulate str and Sherlocked here...
return [str, Sherlocked];
},
/*
* Takes a Sherlocked object, and returns that Sherlocked object with any desired modifications.
*/
postprocess: function(Sherlocked) {
// Manipulate Sherlocked here...
return Sherlocked;
},
/* Config vars for disabling certain features */
config: {
// Should Sherlock try to parse time ranges and return an endDate?
disableRanges: false
}
};
})();