Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I want to capture the complete word at a given point (for example, cursor position), but GetWord give me the total text on the horizontal line. Whats the problem?

0
Posted

I want to capture the complete word at a given point (for example, cursor position), but GetWord give me the total text on the horizontal line. Whats the problem?

0

Let you want to capture the text at a given position, for example, the mouse cursor position. Let the line text is ” Many people use Google to search things. Google is a great searching engine.” If you put the mouse cursor on the ‘o’ of the second Google, GetWord will return: 1. the total string: Many people use Google to search things. Google is a great searching engine. 2. the cursor position: 42 In our demo program (You can find it at http://www.textcapture.com), you will find the two items as ‘All Text’ and ‘Cursor Pos’ respectively. ‘Cursor Text’ is calculated according to the total string and the cursor position. Generally, if you want to capture the complete word or phrase at a given point, you need a dictionary which contains the words or phrases you want to recognize. When you get the total string and the point position in the string, you can look up the dictionary to determine what should be returned. For some simple cases, you can use regular expression instead of a dictiona

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123