VS 2008 - Check For Most Matching String

Jun 9, 2010

I want to check each of the strings in an array (currently in a hashtable, but that shouldn't necessarily matter right?) with the user's input, if the words in each of them match. This might have sounded a little tricky so let me elaborate.

Problem: Comparing an input string with a collection of strings, and know which string in the collection matches the input string the most - based on words. What I'm trying to do here is a chatbot that works with keywords. For example, in the bot script, you could find "HOW ARE YOU" and the response "I am fine." If the user then sends input to this bot, it could look like this: [Code] This may not sound like a tricky thing, but the tricky part comes when I want to know which of the strings (e.g. "HOW ARE YOU") match the input string the most, based on the words.

View 1 Replies


ADVERTISEMENT

Excel :: Check Matching Rows And Transpose Accordingly

Aug 31, 2009

I have this problem with this macro. I think it's a VERY common problem, but I just kind find a straight answer since it's so specific.

I have data like this:
juanA50
juanB60
juanD70
pedroA50
pedroC70
pedroD80
pedroF90
felipeA50
felipeH100
felipeL200

The first column is the name of the employee.
The second one contains the name of payment concepts (salaries, insurance, etc).
The third column contains the actual amount to be charged or discharged.

The desired output should be like this:
___A_B_C_D_E_F_H_L
juan_50_60__70___
pedro_50__70_80__90__
felipe_50____100_200

Delete duplicated values in the names, merge the matching rows of an employee and put them in the correct colum that matches the payment concept. I'm using SQL Server 2000 and Excel 2007, so feel free to talk about querys and Excel 2007 new functions. This is done with a VB6 application (not VBA), so I'm using Excel's object model as a reference in my project. I was originally trying to do it with SQL Server, instead with a macro, but I couldn't find a way.

View 2 Replies

VS 2010 String Matching?

Jul 22, 2011

In javascript I know you can put for instance if date= "2010"* which would do the if for the string if it starts with 2010 but it doesn't matter what comes after that.

View 4 Replies

Matching Text String On First Letter In SQL Query

Feb 28, 2012

[Code]...

In this exmample textData is a string of text and alpha is a single letter a through z or A through Z. I don't need the criteria to be case sensitive, but I do need only the first letter of textData to match alpha. I have tested the LIKE comparator and it does not return all records that begin with alpha.

View 3 Replies

Return Rows That Have A Matching String To Predefined List?

Jul 8, 2009

1 within each section of a SplitContainer. The left hand side will be for inputing text that is copied/pasted from a word, excell, or text file.The right hand side would be for my output. What I would like it to do is return just the rows from the left hand side that contain a match to any one of the predifined strings. This will be used to search large lists of company names and circuit IDs and return the rows with matching namesSo far I have the form created, the Splitcontainer in place along with the richtextbox on each side and a submit button at the bottom.

View 12 Replies

Searching Text Box Input For Matching String Values?

Jul 8, 2009

I have to scan through documents. Excell, Word, txt, ect looking for company names that match a pre-difined list of companies.I then email the companies some specifics in regards to that doc.The problem I have been having recently is that the list of companies keeps growing and I am starting to miss some more than I used to.What I would like to build is a tiny app that has 2 Text boxes.1 on the left for input (where I would copy/paste) the document text I receive.and one on the right for the output where it will highlight any line that contains the name of any of the pre-defined companies.

I started toying with the idea and so far I have form with a SplitContainer. Within that SplitContainer each side has a TextBox... Below the Textbox on the left hand side splitcontainer I have a submit button with no actions currently assigned to it.

View 6 Replies

Finding A Matching String From A Partial Search (fuzzy Logic?)

Jul 6, 2011

I have a list of names of players and their names in some game. Now an administrator of that game might want to contact one of the players by sending him a message. He does that by writing a command that basically has the format "tell <player> <message>", where <player> is the name of the player.The problem is simple: player names might be quite complicated and long (it's their screen name not their real name), and it would take the admin quite some time to find out how to spell the name exactly and he will probably make a few mistakes. Basically, having the admin type out the exact name is not practical.So I am trying to implement a 'fuzzy logic' search (is that even the correct term?) but with a twist, I guess.The idea is that the admin can type just part of the name and is even allowed to make a couple mistakes. For example, suppose a player has a screen name of "Mr.Smith34", then the admin should be able to type, for example.[code]

The problem now is that there can be absolutely no ambiguity in which player is meant. Instead of sending a message (which is quite harmless) the admin should also be able to 'kick' or ban someone from a game server, banning them from ever playing there again. Obviously, the admin should then not accidently ban a player named "Mrs.Smith" when he meant "Mr.Smith"! My solution (unless someone else can come up with something better) is to just not allow the command if there are multiple matches. If the admin searches for 'smith' and there are multiple names that are similar to 'smith' (maybe even 'sith' or similar) then I disregard that search and tell the admin he needs to try again with a more specific name.(If all else fails he can always look up the ID of the player and use that, which should be foolproof as long as the admin doesn't make a mistake and picks the wrong ID..., but that is even more work it does not have preference).But this brings further problems. The example I just gave might be good: suppose there's a player "Mr.Smith" and a player "Sith". If the admin searches for 'Smith' then there should be no question who he meant (Mr.Smith), but I am sure any fuzzy logic implementation would count Sith as a very close match... Another thing is that my solution of only allowing the search if there is just a single match probably wouldn't work. I have never used fuzzy logic searching before, but I can imagine some names being marked as 'slightly similar' even when they are completely different ('smi' might match 'smith', but also 'ims' perhaps, in which case it would possibly match a whole new range of names), even though 'for humans' it is clear which result is meant.

I am assuming any fuzzy search would return the matches and rate them according to how similar they are to the search term. Perhaps I can choose some kind of cut-off value, where any matches that are less than 30% similar (I've no idea just guessing here) are assumed not equal whereas higher ranked matches are assumed a possible match. Perhaps this makes it easier (perhaps harder, I dunno), but I forgot to mention that the search term cannot contain any spaces. Player screen names can contain spaces though. I am thinking to just strip out the spaces of each name before starting the search, but perhaps there are better solutions in combination with fuzzy searching...

View 13 Replies

VS 2008 - Check For The Letters Of The Given String

Feb 20, 2010

I want to check for the letters of the given string. for example: the string = Visual Studio next is i want to check per letter of the string. next I want to change V to x

View 1 Replies

VS 2008 Check If String Is A Word

Jan 15, 2010

Is there any function or collection in VB.NET that checks if a string is a word? Like a dictionary?I'm making a random word generator, and I can get it to generate random strings, but it's be better if they were actual English words..I know something like System.Collections.Generic.Dictionary would work, but wouldn't you first have to add all of the words into the Dictionary?I guess what I'm looking for is a Collections.Generic.Dictionary with English words preloaded into it?

View 7 Replies

[2008] Check If Value Is In String Array?

Feb 18, 2009

How would I check if a value is in a string array? Like say there is pages(10) and pages(5) is "rhijaen" I want it to do something like:

If "rhijaen" isin pages() then
dothis
end if

View 7 Replies

Programming Syntax - Searching An Array For A String Matching Input - Visual Basic

Jan 20, 2012

I can't figure out the syntax for searching an array of stored words for a string matching an input string. I understand the pseudocode of it, but I'm tripping up over what variables I need to put where, and how they should be formatted. More than happy to provide more details should anyone request them.

[Code]...

View 1 Replies

Regex - Matching And Replacing The Contents Of Multiple Overlapping Sets Of Brackets In A String?

Jun 5, 2011

I am using vb.net to parse my own basic scripting language, sample below. I am a bit stuck trying to deal with the 2 separate types of nested brackets.

Assuming name = Sam
Assuming timeFormat = hh:mm:ss
Assuming time() is a function that takes a format string but
has a default value and returns a string.

[code]....

I could in theory change the syntax of the script completely but I would rather not. It is designed like this to enable strings without quotes because it will be included in an XML file and quotes in that context were getting messy and very prone to errors and readability issues. If this fails I could redesign using something other than quotes to mark out strings but I would rather use this method.

Preferably, unless there is some other way I am not aware of, I would like to do this using regex. I am aware that the standard regex is not really capable of this but I believe this is possible using MatchEvaluators in vb.net and some form of recursion based replacing. However I have not been able to get my head around it for the last day or so, possibly because it is hugely difficult, possibly because I am ill, or possibly because I am plain thick. I do have the following regex for parts of it.

Detecting the parentheses: (w*?)((.*?))(?=[^(+)]*((|$))
Detecting the square brackets: [[(.*?)]](?=[^[+]]*([[|$))

View 2 Replies

Argument Matching Parameter 'separator' Narrows From 'String' To &#391;-dimensional Array Of Char'. ERROR?

Dec 28, 2011

Argument matching parameter 'separator' narrows from 'String' to &#391;-dimensional array of Char'. ERROR

View 7 Replies

VS 2008 Check All Labels On Form To See If Label Name Has Certain String Within It?

Dec 19, 2009

I have a form that has a large number of labels. Is there a way I can move the focus from label to label. After I move the focus I'll check if the name of the label has a certain string in it. If it does then I'll leave the focus at that label. If it doesn't I'll move the focus to the next label and check if that label name has the string in it. I just need to know how to move the focus from label to label. I was trying SelectNextControl without success. Maybe I can tab programmatically to the next label but I don't know how to do that.

View 12 Replies

VS 2008 Regex Matching And Results?

Apr 17, 2009

i'm really new at the VB language only been doing for around 2 weeks.I hoping someone can help me with this, how would i get this USERNAME, USERID from a string

Adding the USERNAME to listbox, and then USERID into an array separated by a space. - I no how to do this part just the regex above remember i've only been doing for two weeks so i'm not very knowledged at this.

View 11 Replies

VS 2008 - Matching Comboboxes With Main Form

Jun 13, 2010

I have a combobox on my main form and it lists geographical locations that the user creates. How do I make the combo-boxes on the sub forms match the one on the main form?

View 1 Replies

VS 2008 Multiline Regex Matching Doesn't Work

Sep 5, 2009

I've been working with Regex and I've run into something that doesn't make sense to me; I either misunderstood how the Multiline option works, I'm not using it right, or it really just doesn't work like it's supposed to. This is a little test I made:

[Code]...

View 18 Replies

Searching For An "almost" Matching String In Txt File

Nov 28, 2011

I am trying to search for a particular string on a *.txt file, while i can do this i want to be able to do it without having to type the exact string.

For example:

if i search "string" i find "string" but not "String" the big letter wrecks the search... anyone knows how to do a search like this?

And i want also to give me an incremental search while i am typing on a list box.
For example:

if i type "s" it appears, sangoku,slb, siemens,sentence,...., string,...

on the listbox. These are words that exist on the *.txt file i am reading.

if i type "st" it appears only string and any other word that starts with "st"

it would be an automatic search without having to press enter, or any search button. Just by pressing the keyboard on the letter we wanted the search would be made.

View 6 Replies

Check If String, Which Receive Via A Serial Port Matches To A String In A Database (access)?

Jun 22, 2010

I got an app, which receives data via a R232 port, convert it to a string and on the other side I got a database, where the strings are saved. How can I find a way to compare the string with all strings in one database column and get back the another stringform the same row in this database. I never programmed a database

View 1 Replies

VS 2008 Feed A Multi Line Textbox Into A String Array Then Check Item By Item

Jul 25, 2010

I've been trying to feed a multi line textbox into a string array then check item by item if a string contains part of it.

[Code]...

View 2 Replies

Regex - How To Check If The Input String Is A Valid VB String

Mar 15, 2009

We know that VB string start and end with double quotes " "

So we have to use "" if we want " in VB string.

I wonder if there is a regular expression pattern which will match VB string?.

View 2 Replies

VS 2008 Auto-number To Long Relationship - Get A "no Matching Field Type" Error

May 26, 2009

When i try to stablish a relationship in dataset designer of these two types i get a "no matching field type" error I'm working with an accdb database

View 2 Replies

VS 2008 Allow User To Only Check One Check Box On CheckedListBox1

Mar 6, 2010

How can i allow the user to only check one check box on a CheckedListBox1..I was thinking of using a timer but that might be a stupid thing to do.

View 3 Replies

.net - Check If A String Is UTF-8?

May 17, 2011

I want to check if a string is utf-8 encoded.

UPDATE: So, the problem is: I have a php webservice. This webservice has a method that receives a string. I'm trying to pass a VB.NET JSON string to this webservice. json_decode always returns an error, saying that the string is not utf-8. If I pass the string and convert it using PHP utf8_encode, the accents get wrong!

View 2 Replies

C# - Check For " In String?

Jun 7, 2012

I am struggling to check for a " in a string in vb.net. Could anybody suggest a way to look for " in string as we do in c# using " " "

I have tried with, " and "" but of no use.

If partnerItem.Contains("*") Or partnerItem.Contains(""") Then
isBad = True
reportError(i + 1, colDetails(0), colDetails(1), "Field cannot contain " & PARTNER_ITEM_INVALID_CHARACTERS & " characters.")

View 3 Replies

Check A String If It Contains Particular Words

Apr 23, 2010

The following code checks a strings if it contains particular words and if yes it removes them. The problem is that it also removes characters that it shouldn't. For example: If user_input3 contains a word like lo(ok) it would remove the last characters ok. How can i modify the code to remove whole words only?

[Code]...

View 8 Replies

Check And Replace String?

Apr 30, 2011

I have a string, lets say "((HRARNT*50)/100) + ((HRA*10)/100)"

And, i have value for HRA, HRARNT in a DGV and i want to replace it with its value to get "((5000*50)/100) + ((3500*10)/100)"

But, problem arises when it replace HRARNT with "3500RNT" as it got HRA value in DGV.

Now, i want it to first check if its prefixed or suffixed with +,-,*,/,),( then only it should replace with its subsequent value from DGV.

Though, first i tried placing HRA,HRARNT in [] and then replace, which worked fine, but users don't want to add [].

How to implement above logic?

View 4 Replies

Check For A Certain Suffix In My String?

Apr 10, 2011

I got a list of strings. And I want to check for every string in there. Sometimes, a string can have the suffix _anim(X) where X is an integer. If such string has that kind of suffix, I need to check for all other strings that have the same "base" (the base being the part without suffix) and finally group such strings and send them to my function.[code]...

View 1 Replies

Check For A Number In A String?

Jun 21, 2010

I'm reading data in from a comma-separated text file and storing the data in an array for later use. Some of the values are to remain as strings, and I need to convert some to integers, for which I was trying to use, for example, integer.parse(ar(0)).

My problem is that the string values are randomly distributed through the text file, so I need to be able to test whether the string can be converted at all before doing the conversion.

View 3 Replies

Check For Certain Characters In A String?

May 17, 2011

I am just a beginner in VB programming. What if I want to check if a certain subtext is present in a string? For example, what do I code if I want to check if the word "hello" is present in a particular string or not?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved