Mercurial > hip
annotate hip.js @ 18:5fce4c8f3ebd
Preliminary version of date stuff added
author | jonathandicarlo@jonathan-dicarlos-macbook-pro.local |
---|---|
date | Tue, 15 Jul 2008 14:10:17 -0700 |
parents | a26372118854 |
children |
rev | line source |
---|---|
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
1 function dictDeepCopy( dict ) { |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
2 var newDict = {}; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
3 for (var i in dict ) { |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
4 newDict[i] = dict[i]; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
5 } |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
6 return newDict; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
7 }; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
8 |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
9 function dictKeys( dict ) { |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
10 return [ key for ( key in dict ) ]; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
11 } |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
12 |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
13 function getSelection () { |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
14 return $("#fake-selection").attr( "value" ); |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
15 } |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
16 |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
17 var wordsThatReferToSelection = [ "this", "that", "it", "selection", "him", "her", "them"]; |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
18 |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
19 function ParsedSentence( verb, DO, modifiers ) { |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
20 this._init( verb, DO, modifiers ); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
21 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
22 ParsedSentence.prototype = { |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
23 _init: function( verb, DO, modifiers ) { |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
24 /* modifiers is dictionary of preposition: noun */ |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
25 this._verb = verb; |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
26 this._DO = DO; |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
27 this._modifiers = modifiers; |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
28 }, |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
29 |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
30 getCompletionText: function() { |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
31 // return plain text that we should set the input box to if user hits |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
32 // space bar on this sentence. |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
33 var sentence = this._verb._name; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
34 if ( this._DO ) { |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
35 sentence = sentence + " " + this._DO; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
36 } |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
37 for ( var x in this._modifiers ) { |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
38 if ( this._modifiers[x] ) { |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
39 sentence = sentence + " " + x + " " + this._modifiers[x]; |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
40 } |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
41 } |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
42 return sentence; |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
43 }, |
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
44 |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
45 getDisplayText: function() { |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
46 // returns html formatted sentence for display in suggestion list |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
47 var sentence = this._verb._name; |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
48 if ( this._verb._DOType ) { |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
49 if ( this._DO ) { |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
50 sentence = sentence + " " + this._DO; |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
51 } else { |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
52 sentence = sentence + " <span class=\"needarg\">(" + this._verb._DOLabel + ")</span>"; |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
53 } |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
54 } |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
55 |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
56 for ( var x in this._verb._modifiers ) { // was this._verb._modifiers |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
57 if ( this._modifiers[ x ] ) { |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
58 sentence = sentence + " <b>" + x + " " + this._modifiers[x] + "</b>"; |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
59 } else { |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
60 sentence = sentence + " <span class=\"needarg\">(" + x + " " + this._verb._modifiers[x]._name + ")</span>"; |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
61 } |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
62 } |
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
63 return sentence; |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
64 }, |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
65 |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
66 getDescription: function() { |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
67 // returns a string describing what the sentence will do if executed |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
68 return this._verb.getDescription( this._DO, this._modifiers ); |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
69 } |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
70 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
71 }; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
72 |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
73 |
18
5fce4c8f3ebd
Preliminary version of date stuff added
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
14
diff
changeset
|
74 var gQs = new QuerySource([ fly, define, google, go, close, open, translate, email, nuke, encrypt, wiki, calendarize ], |
5fce4c8f3ebd
Preliminary version of date stuff added
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
14
diff
changeset
|
75 [city, language, tab, person, application, DateNounType, AddressNounType]); |
1
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
76 |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
77 function makeSuggestionHtml( tagName, list, hilitedNumber ) { |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
78 var result = ""; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
79 var openingTag = ""; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
80 var closingTag = "</" + tagName + ">"; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
81 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
82 for (var i = 0; i < list.length; i++) { |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
83 if ( i == hilitedNumber ) { |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
84 openingTag = "<" + tagName + " class=\"hilited\">"; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
85 } else { |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
86 openingTag = "<" + tagName + ">"; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
87 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
88 result += (openingTag + list[i] + closingTag ); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
89 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
90 return result; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
91 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
92 |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
93 function updateDisplay( number ) { |
6
98935af12b04
Debugged the recursive part of the parsing algorithm, so it now recognizes multiple prepositions in any order. Still some bugs.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
5
diff
changeset
|
94 var suggestions = gQs.getSuggestionsAsHtml(); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
95 var hilitedSuggestion = gQs.getHilitedSuggestion(); |
7
aab0d14248f5
All suggested completions now return sensible descriptions of what they would do if executed.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
6
diff
changeset
|
96 var description = gQs.getDescriptionText(); |
aab0d14248f5
All suggested completions now return sensible descriptions of what they would do if executed.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
6
diff
changeset
|
97 $("#status-line").html( description ); |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
98 if ( hilitedSuggestion == -1 ) { |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
99 // TODO set #search-box background to green, not sure how |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
100 } else { |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
101 // TODO set #search-box background to white, not sure how |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
102 } |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
103 var ac = $("#autocomplete-popup"); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
104 ac.html( makeSuggestionHtml( "div", suggestions, hilitedSuggestion ) ); |
7
aab0d14248f5
All suggested completions now return sensible descriptions of what they would do if executed.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
6
diff
changeset
|
105 ac.show(); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
106 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
107 |
1
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
108 function searchBoxQuery( event ) { |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
109 // TODO: if the event is an 'esc' key, clear the input field. |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
110 // If the event is an 'up arrow' or 'down arrow' key, change the |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
111 // indication. |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
112 |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
113 // key is event.which |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
114 // esc is 27 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
115 // up arrow is 38 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
116 // down arrow is 40 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
117 // enter is 13 |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
118 // space is 32 |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
119 var input = event.target.value; |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
120 switch( event.which ) { |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
121 case 27: //esc |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
122 event.target.value = ""; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
123 gQs.clear(); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
124 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
125 case 38: // up arrow |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
126 gQs.indicationUp(); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
127 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
128 case 40: // down arrow |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
129 gQs.indicationDown(); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
130 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
131 case 13: // enter |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
132 gQs.execute(); |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
133 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
134 case 32: // spacebar |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
135 //input = gQs.autocomplete( input ); |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
136 gQs.updateSuggestionList( input ); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
137 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
138 default: |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
139 gQs.updateSuggestionList( input ); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
140 break; |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
141 } |
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
142 |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
143 updateDisplay( event.which ); |
4
4ea09b7ce820
Added verbs and nouns and up/down arrows and space-to-autocomplete and suggestion list and escape-to-clear.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
1
diff
changeset
|
144 |
1
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
145 } |
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
146 |
0 | 147 $(document).ready( function() { |
13
8dcc88f93829
Broke up hip.js into some smaller js files
jonathandicarlo@localhost
parents:
12
diff
changeset
|
148 $("#status-line").html( "All you gotta do is rub that lamp." ); |
0 | 149 $("#search-box").focus(); |
1
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
150 $("#search-box").keyup( searchBoxQuery ); |
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
151 $("#autocomplete-popup").css( |
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
152 "width", |
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
153 $("#search-box").css("width") |
a31bdc4de955
Added autocomplete popup and querysource class
Atul Varma <varmaa@toolness.com>
parents:
0
diff
changeset
|
154 ); |
0 | 155 }); |
5
a049cb93db46
Now doing a much smarter parsing of the rest of the sentence after the verb, and describing expected arguments in (italics).
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
4
diff
changeset
|
156 |
10
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
157 /* Where to go next: |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
158 |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
159 1. Noun-first completions. If you type "london", it matches no verb, so |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
160 the parser looks at the known noun categories, sees that "london" could be |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
161 a city, and then looks for verbs that take cities and suggests |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
162 fly to london |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
163 fly from london |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
164 nuke london |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
165 |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
166 3. Allow the possibility of a multiple-word indirect-object. |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
167 (Maybe pass the whole rest of the sentence past the preposition as an argument |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
168 to the noun class, and as the noun class returns the list of suggestions, |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
169 it also returns a count of how many words it has used.) |
10
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
170 |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
171 4. Preview output of topmost or hilited command, as you type. |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
172 |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
173 5. When a command is executed, put its output in a special buffer that forms |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
174 the implicit selection for the next command. In this way commands can be |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
175 chained conversationally, without the need for a special word or key to |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
176 link them together. |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
177 |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
178 6. More complex datatypes, like dates, that allow for multiple input formats. |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
179 ( see http://www.datejs.com/ ) |
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
180 |
11
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
181 7. Make verbs more tolerant of text that doesn't match the direct object. |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
182 First of all, if the direct object text is just spaces (and how does that |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
183 happen?) it should be discarded. And then, if there's input that can't |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
184 be used, maybe discard it or put it in red or something, rather than |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
185 rejecting it. |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
186 |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
187 8. Tweak what text gets autocompleted when you arrow down to something |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
188 and hit space. Right now it's putting in prepositions that you haven't |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
189 actually typed. |
9e18b8d8c936
Added simple text-selection support; use words like 'this', 'selection', or 'it' to refer to your selection. It will be interpolated in the correct position in your sentence. I don't have a selection-grabbing mechanism yet (it's beside the point) so I just added a text input field to hip.html that we will pretend is your selection for not.
jonathandicarlo@localhost
parents:
10
diff
changeset
|
190 |
12
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
191 9. Learn how frequently you use different completions (use the algorithm |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
192 we've already developed) and rank accordingly. |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
193 |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
194 10. Start sorting matches by goodness. |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
195 |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
196 11. Have nounTypes that can learn new entries!!! |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
197 |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
198 12. Make it so when hilite is 0, the literal input is hilited green |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
199 and an appropriate suggestion is displayed! |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
200 |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
201 13. Break this file into multiple files, it's getting really big. |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
202 |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
203 14. Use Tab to mean "copy hilited suggestion to input box" |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
204 (No, we can't do that! Because tab changes focus away from the input |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
205 box.) |
aa56c4aa5b11
You can use pronouns to refer to your selection, which is pulled from a 'pretend this is your selection' input box.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
11
diff
changeset
|
206 |
10
8f6b1c89d8de
With the basic demo functionality ready to go, I added a list of What To Do Next.
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
parents:
9
diff
changeset
|
207 */ |