How to add #SearchBang tag. #1177
-
A search bang looks like a #HashTag or #AtMention that starts with a
So adding the simple version of the #SearchBang tag seems pretty straight-forward... However, there are some complications:
Is there a way to add the complex version of the #SearchBang tag? Or would it be easier to parse the search bangs and strip them from the text before sending them to NLP compromise? My use-case is analyzing the input to a textarea to determine the best action/transformation:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey John, this sounds like a cool project. I really like this sort feature. I think there is a similar function in duckduckgo? It would be great if we could contribute to some sort of standard for this. A lot of people use compromise for this and yeah - it also seems whitelist-based. The plugin should accept possible bang-inputs, and normalize and only tag those, right? lemme know if we're on the same page, I can take a crack at getting this started. |
Beta Was this translation helpful? Give feedback.
-
hey John-Kim, I started some work on a command-prompt plugin. There are some tiny weird things that I'd like to change for the next release. console.log(nlp('! we walk').docs[0])
/*[
{
text: 'we',
pre: '! ', // ends up here
post: ' ',
tags: Set(1) { 'SearchBang' }
},
{
text: 'walk',
pre: '',
post: '',
tags: Set(3) { 'Verb', 'PresentTense', 'Infinitive' },
normal: 'walk',
}
]*/ really, this should obey any words that are entered into the lexcion, even if the word is Second, I started on a slash command one too? For things like "/me writes more code" to be optionally recognized as a command. The 'slots' concept you discussed is a strong and well-supported feature of compromise. Let me know if you struggle anywhere to implement it. Lastly, like you mentioned, it should have the facility to fuzzy-match on a list of recognized command labels. I haven't gotten to a clear understanding of how this should work, but the fuzzy match functionality is already in compromise main. It doesn't rank things, so maybe this plugin should do its own edit-distance scoring. that's all i got for now. Let me know how things go on your side, and if I can help with anything |
Beta Was this translation helpful? Give feedback.
hey John-Kim, I started some work on a command-prompt plugin. There are some tiny weird things that I'd like to change for the next release.
For one - your example with a bare
!
as a single word. You'll see the tokenizer bolts it onto the preceding word, so it's hard to pull-out:really, this should obey any words that are entered into the lexcion, even if the word is
'!'
.Second, I started on a slash command o…