How to build a Smart Compose like Gmail? Possible in a textarea?
up vote
2
down vote
favorite
The new predictive type feature Smart Compose of Gmail is quite interesting.
Let's say we want to implement such a functionality ourselves:
- User enters beginning of text, e.g.
How
and in gray behind it appearsare you?
. - User hits TAB and the word tomorrow is set.
Example:
Can a textarea
with Javascript magic be used to achieve this?
And if not, how could this be implemented otherwise?
javascript html
add a comment |
up vote
2
down vote
favorite
The new predictive type feature Smart Compose of Gmail is quite interesting.
Let's say we want to implement such a functionality ourselves:
- User enters beginning of text, e.g.
How
and in gray behind it appearsare you?
. - User hits TAB and the word tomorrow is set.
Example:
Can a textarea
with Javascript magic be used to achieve this?
And if not, how could this be implemented otherwise?
javascript html
Perhaps using adiv
with the attributecontenteditable
may be a better approach as it allows you to style the text within the textarea itself.
– Nick Parsons
Nov 19 at 12:40
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to aspan
incontenteditable
div
with css set to make it look gray and off colored.
– Vijay Rathore
Nov 19 at 12:58
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
The new predictive type feature Smart Compose of Gmail is quite interesting.
Let's say we want to implement such a functionality ourselves:
- User enters beginning of text, e.g.
How
and in gray behind it appearsare you?
. - User hits TAB and the word tomorrow is set.
Example:
Can a textarea
with Javascript magic be used to achieve this?
And if not, how could this be implemented otherwise?
javascript html
The new predictive type feature Smart Compose of Gmail is quite interesting.
Let's say we want to implement such a functionality ourselves:
- User enters beginning of text, e.g.
How
and in gray behind it appearsare you?
. - User hits TAB and the word tomorrow is set.
Example:
Can a textarea
with Javascript magic be used to achieve this?
And if not, how could this be implemented otherwise?
javascript html
javascript html
asked Nov 19 at 12:36
Kai Noack
6,096659113
6,096659113
Perhaps using adiv
with the attributecontenteditable
may be a better approach as it allows you to style the text within the textarea itself.
– Nick Parsons
Nov 19 at 12:40
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to aspan
incontenteditable
div
with css set to make it look gray and off colored.
– Vijay Rathore
Nov 19 at 12:58
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44
add a comment |
Perhaps using adiv
with the attributecontenteditable
may be a better approach as it allows you to style the text within the textarea itself.
– Nick Parsons
Nov 19 at 12:40
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to aspan
incontenteditable
div
with css set to make it look gray and off colored.
– Vijay Rathore
Nov 19 at 12:58
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44
Perhaps using a
div
with the attribute contenteditable
may be a better approach as it allows you to style the text within the textarea itself.– Nick Parsons
Nov 19 at 12:40
Perhaps using a
div
with the attribute contenteditable
may be a better approach as it allows you to style the text within the textarea itself.– Nick Parsons
Nov 19 at 12:40
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to a span
in contenteditable
div
with css set to make it look gray and off colored.– Vijay Rathore
Nov 19 at 12:58
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to a span
in contenteditable
div
with css set to make it look gray and off colored.– Vijay Rathore
Nov 19 at 12:58
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374806%2fhow-to-build-a-smart-compose-like-gmail-possible-in-a-textarea%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Perhaps using a
div
with the attributecontenteditable
may be a better approach as it allows you to style the text within the textarea itself.– Nick Parsons
Nov 19 at 12:40
contenteditable
div
should do the trick. You will also need a fast dictionary service which will return suggestions. Just add the suggested word to aspan
incontenteditable
div
with css set to make it look gray and off colored.– Vijay Rathore
Nov 19 at 12:58
Are you asking this narrowly in terms of the frontend aspect of implementation or are you curious about the backend, as well? I ask 'cause I'd like to know about the backend and'll create a new question of this one isn't meant to be about that but won't otherwise. And, @VijayRathore, I suspect this feature goes way beyond dictionaries for prediction; e.g., when I type How I get "How've you been?" instead of "How are you?" presumably 'cause the former is something I tend to write. I imagine that some modeling of users' style is going on. I wanna know how all that's done.
– tjfwalker
Nov 21 at 21:12
I am only interested in the front-end currently. Two options: I broaden the question to frontend and backend, or you ask a separate one. I am pretty sure they have analyzed the user's existing emails, go through it, and suggest the text. Probably using the same functionality that is behind Google Suggest.
– Kai Noack
Nov 21 at 21:44