Questions tagged [string-search]

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

Use this tag for programming questions related to string searching algorithms.

Source: Wikipedia

261 questions
3
votes
1 answer

Efficiently match multiple strings/keywords to multiple texts in R

I am trying to efficiently map exact peptides (short sequences of amino acids in the 26 character alphabet A-Z1) to proteins (longer sequences of the same alphabet). The most efficient way to do this I'm aware of is an Aho-Corasick trie (where…
Matt Chambers
  • 2,229
  • 1
  • 25
  • 43
3
votes
1 answer

Data structure to index entire document and algorithm for quick search of any size substring

I'm trying to find a data structure (and algorithm) that would allow me to index an entire text document and search for substring of it, no matter the size of the substring. The data structure should be stored in disk, during or at the end of the…
Silas
  • 392
  • 1
  • 4
  • 15
3
votes
5 answers

String searching algorithms in Java

I am doing string matching with big amount of data. EDIT: I am matching words contained in a big list with some ontology text files. I take each file from ontology, and search for a match between the third String of each file line and any word from…
Julia
  • 1,217
  • 8
  • 23
  • 46
3
votes
1 answer

Smart string search for small collections

I have a pretty small collection of string values in memory (around 8400 records with an average of 10 words each): What I'm trying to find out if there's a library or something that, when I search for strings within that collection, it returns the…
Silvestre
  • 804
  • 11
  • 25
3
votes
6 answers

"tailing" a binary file based on string location using bash?

I've got a bunch of binary files, each containing an embedded string near the end of the file but at different places (only occurs once in each file). I need to extract the part of the file starting at the location of the string till the end of the…
ilitirit
  • 16,016
  • 18
  • 72
  • 111
3
votes
1 answer

Ignore acutes in LINQ when using "Contains"

Is it possible in pure LINQ-to-entities to use String's Contains() method without considering the acutes? Example: table Messages --------------------------- MessageId Body 1 Hello John how are you 2 Hi Jóhn sup? …
sports
  • 7,851
  • 14
  • 72
  • 129
3
votes
3 answers

SQL fetch results by concatenating words in column

I have column store_name (varchar). In that column I have entries like prime sport, best buy... with a space. But when user typed concatenated string like primesport without space I need to show result prime sport. how can I achieve this? Please…
Durga
  • 93
  • 9
3
votes
3 answers

find frequency of every word

There is a question asked to me in the interview, but I am not able to answer that. Question is : You are given a directed graph in which every node is a character and you are also given a array of strings. The task is to calculate the frequency of…
devsda
  • 4,112
  • 9
  • 50
  • 87
2
votes
4 answers

what algorithm does freebase use to match by name?

I'm trying to build a local version of the freebase search api using their quad dumps. I'm wondering what algorithm they use to match names? As an example, if you go to freebase.com and type in "Hiking" you get "Apo Hiking…
stackOverlord
  • 5,342
  • 6
  • 28
  • 29
2
votes
2 answers

Implement "Did you mean?" with Core Data

I'm working on an iOS app. I have a Core Data database with a lot of company names. When the user insert a company name that does not exist, I would like to show "similar" company names. For example, if the user entered "Aple", I would like to show…
Dev
  • 7,027
  • 6
  • 37
  • 65
2
votes
2 answers

Matching multiple strings to one long string using patterns

I have a line of DNA code and I'm trying to use a Java regex expression to match the codon (3 letter sequence) to an amino acid. Below is an example of one of the patterns: Pattern A = Pattern.compile(("gct")||("gcc")||("gca")||("gcg")); This…
user1058210
  • 1,639
  • 7
  • 29
  • 49
2
votes
3 answers

Rabin-Karp string search algorithm

My previous question pertained to the general string search algorithm. I am researching the Rabin-Karp algorithm and I have a function template like: RabinKarpMatch(char *Text, char *Search_phrase,int radix,int prime) I wanted to know how the…
Prasanth Madhavan
  • 12,657
  • 15
  • 62
  • 94
2
votes
1 answer

AppEngine Approximate Partial String Matching Algorithm

So, I realize that this covers a wide array of topics and pieces of them have been covered before on StackOverflow, such as this question. Similarly, Partial String Matching and Approximate String Matching are popular algorithmic discussions, it…
ashays
  • 1,154
  • 1
  • 12
  • 30
2
votes
3 answers

Specify Column and Row of a String Search

Because I'm working with a very complex table with nasty repeated values in variable places, I'd like to do a string search between specific rows and columns. For example: table={{"header1", "header2", "header3", "header4"}, {"falsepositive",…
Rose
  • 129
  • 6
2
votes
2 answers

Would it make sense to use MemoryMappedFile to perform a search on large text files?

I'm tasked with implementing a search function that will search through several large (couple MB) log files and return the lines that contain the keywords. Log files are constantly being added to the pool so the search has to be dynamic every time.…
Jamie Curtis
  • 918
  • 1
  • 10
  • 24