How to check if selected text is a valid word - vba

Question sounds easy as we think but I couldn't find a solution with any of this: regexp, asc, check space around
For example, in text "Hello world", I can allow "Hello" or "world", but I should not allow user-selection like "Hel", "Worl"
So, if user not selecting a full-word, then I should throw an error. Any thoughts please?

create a dictory with all english words.
then you cound check the text is valid or not.
The all words you could get from web api like below:
http://developer.dictionary.com/
http://googlesystem.blogspot.com/2009/12/on-googles-unofficial-dictionary-api.html

Related

In Jira Wiki format only part of word

When i write in Jira wiki page:
player*Id*
I want only part of word to be formatted (bold): "Id". But jira writes it literaly:
player*Id*
I want it to write:
playerId
If i make whole playerId bold, it works though. How to make only part of word bold in jira wiki?
I think it's not possible, as parser requires spaces next to asterisks to display it correctly.
What you can do is to use color instead:
Player{color:red}Id{color}
Which would be displayed like this:

VB.NET Console and RichTextBox difficulties

I am new here. I am very happy that I joined this website, because everyone here is so smart!
Now, let's cut to the chase! Hopefully, I will be able to explain everything properly.
I am creating a Visual Basic application. It's supposed to reassemble a so-called "fake programming language." It's having some issues though.
Let me show you an example before explaining:
If RichTextBox1.Text.Contains("console output >'insert comment';") then
Console.WriteLine("insert comment")
End If
Now, what I want here is a custom input. (if someone types "I want cookies" then I want the console to say that!
For instance, if I type:
If RichTextBox1.Text.Contains("console output >'Insert something here';") then
Console.WriteLine("Whatever the user wrote!")
End If
I just want to possibility to write whatever I want, that's all! I hope I made myself clear, because I am having a hard time explaining here. Help is appreciated! Thank you!
You need to match just the part with the console output > and then replace that portion of the string with empty space, like this:
If RichTextBox1.Text.Contains("console output >") Then
Console.WriteLine(Replace(RichTextBox1.Text, "console output >", ""));
End If

Lotus Domino database FTSearch method and brackets

I need to search with FTSearch something like this - MS004790(419411/10). But it thorws NotesException: Notes error: Query is not understandable (MS004790(419411/10))
So maybe there is some trick to search strings like that or maybe I need to parse it somehow?
Tnx for help!
TL;DR: Wrap your search in quotes.
Full Text search has two modes. Web Search and Notes Search. In your notes preferences you can set this.
Web search is just like a text search. Notes search attempts to parse the search term.
However the client can fall back to Notes search terms if it sees the first characters are capitals (or capital reserved keywords like "FIELD"). So to prevent it from parsing you need to wrap it in quotes.
For example
(LotusScript)
searchString = |"MS004790(419411/10)"|
(Java)
searchString = "\"MS004790(419411/10)\""
If it is still failing after that, manually try the search in the FT search bar. Once you have that working the code should work the same way.
If it is still failing at that point it may be related to the UNK table. If so see the following:
Lotus Domino: After changing TYPE of a field, Full Text Search won't work for this field

How to get content from the Wikipedia API for a movie?

I tried to get the description of the movie "Your Highness" from the Wikipedia API but it gives me nothing.
http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=your%20highness&prop=revisions&rvprop=content
When I google "Your Highness" wikipedia shows up as the third result, that's the page that I want the API to give me.
Also I just want the text of the description of the movie, no wiki-syntax mixed in or anything.
I was wrong before about the problem being a space - it looks like it was just capitalization. If we just change your URL to use Your%20Highness instead of your%20highness it works:
http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=Your%20Highness&prop=revisions&rvprop=content
EDIT: While not all titles are title-cased (such as "The Name of the Rose") if you use the &redirects query parameter, it sometimes helps - it certainly helps in "the name of the rose" but not for "your highness" for some reason. Wouldn't like to say why, but it's probably worth more investigation...

CompletionProcessor Eclipse Plugin - Replace actual value in the editor

I have a simple question, but I couldn't solve it by myself.
I made a Eclipse Plugin, It's just an editor which has a CompletionProcessor (intelisense assitant). This assistant retrieve a set of phrases take into account a dictionary.
The thing is if i write "word example" in the editor and the assistant proposes "Word as an Example" I would like to replace my actual value for the value that get from my assistant.
To summarize actually when I pick that option , in my editor I get something like the following:
"word example Word as an Example"
And I would like to get just:
"Word as an Example"
Any idea?
The classes I have been using are the following:
org.eclipse.jface.text.contentassist.CompletionProposal;
org.eclipse.jface.text.contentassist.ICompletionProposal;
org.eclipse.jface.text.contentassist.IContentAssistProcessor;
org.eclipse.jface.text.contentassist.IContextInformation;
org.eclipse.jface.text.contentassist.IContextInformationValidator;
I'm gonna answer my own question :).
To solve this you have to use the following constructor of Completion Proposal:
http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/contentassist/CompletionProposal.html#CompletionProposal(java.lang.String,%20int,%20int,%20int,%20org.eclipse.swt.graphics.Image,%20java.lang.String,%20org.eclipse.jface.text.contentassist.IContextInformation,%20java.lang.String)
As you can see two of its arguments are replacementOffset and replacementLength, these are the index to start replacement and the length itself.