As suggestions make sense on your current _live_ node content you just editting, we need a json interface for suggestions.

This should invoke the hook / alter, but passing in the current node body etc.

Feel free to implement :)

CommentFileSizeAuthor
#7 ajax.patch3.82 KBSimpleQuestions

Comments

chawl’s picture

Version: » 6.x-1.x-dev
Component: Code » UX / GUI / Interface

Here comes the rhyme.

Without this, what the use of the Extractor is?

Subscribing :S

eugenmayer’s picture

When you edit a node, you have suggestions based on the node-content which has be "processed" while posting the form to the user.

And sure, the use of such a JSon interface is quiet interesting and important.

Thomas_Zahreddin’s picture

Issue tags: +suggestions

also suits for http://drupal.org/node/691452

-> update the list of terms during userinput: ask the db if eg. terms with the input as filter are less than 30, if less than 30 terms than request these terms and show them on the form for the user.

SimpleQuestions’s picture

I've implemented a rough version of this that uses only extractor since the current service modules support only node-based input. With a few minor modifications this code could provide this functionality into the module if the maintainer wants it. If not I could make an external module, but that seems pretty wasteful since it would only work with this module.

eugenmayer’s picture

Well what a question, we all are interested and so am i.

Could you provide the patch or create a branch on github an patch it there even?

OpenCalais and AlchemieAPi are both providing tags based on the node content, so we should implement it generally, what every "analyzing" tool the developer might want to use.
Extractor is fine for the start, but is should be an exchangeable call. I guess we should build the core functionallity in the core module and the calls in the different submodulee

SimpleQuestions’s picture

All you would need to do is make the sub-modules have a "extract from text" version of the code they use for the node version and then we could implement it the same way as you do for nodes with just a module_invoke instead of using the direct extractor call I use right now.

I have it a bit customized so I'll try to pull out the generalized code and put it in a patch, but like I said it's not quite at that point. It does exactly what I want, but not in a general way. I might just send up a patch as-is and let you decide if you want to run with it or not. It shouldn't take much to generalize the solution.

SimpleQuestions’s picture

StatusFileSize
new3.82 KB

Here's a first try at a patch file, forgive me if I did it incorrectly. I suspect my diff options/directory setup aren't the way you guys do it, but I've never done a drupal patch before.

The patch won't be usable out of the box for you guys because:

1.) I added an ajax loader gif that you'll have to put a replacement in for (I didn't want to include it in the patch)
2.) The taxonomy Id in the unusused tag class names is hardcoded, which I'm not sure if makes any difference or not.
3.) THe issue I discussed above regarding the hardcoding of the extractor. Also note I wrote my own extractor lib that uses synonyms and is case-insensitive which is why I have that second param to the extractor call, but it shouldn't make much of a difference.
4.) This patch is against the current version on the download page, not the dev version.

Let me know if there's something more I can do to help.

eugenmayer’s picture

well that way this patch is rather useless for me. Its looks its more a hack for you current version of tagging. by the way the extractor version you implemented is already implemented in a submodule of tagging (case insensitive + resolution of synonyms + cck support ).

It would be really helpfull if you could extract those new features into a submodule. This submodule includes the ajax callback which :
- calls the suggestions API. That will call the extractor / alchemie api or whatever is used. So dont hardcode the call to the extractor at all
- The menu callback
- the form alter if needed
- the javascript extensions (behavior ) to be loaded and exectuted on "content change" ( ajax callback is fired ). Most probably you will need to use the settings array of tagging to be able to initialize the tagging instances.

All in one, thanks for the contribution but it still needs some love :)

bartezz’s picture

Subscribing

Having suggestions based on live node helps when creating new node content :)