Questions tagged [pattern-finding]
19 questions
42
votes
5 answers
Find the largest convex black area in an image
I have an image of which this is a small cut-out:
As you can see it are white pixels on a black background. We can draw imaginary lines between these pixels (or better, points). With these lines we can enclose areas.
How can I find the largest…

orlp
- 112,504
- 36
- 218
- 315
2
votes
1 answer
How to turn a list of strings into a list of tuples by finding the largest repeating patterns in them in python3?
I was trying to find solution for my problem for some time but couldn't find any good idea yet..
I have a list of large strings where some character patterns (there are no spaces) are repeating. For my needs I need to reduce the memory these strings…

Amae Saeki
- 65
- 1
- 5
1
vote
0 answers
Finding structure within a string
thank you for looking at my first post. I need to find within a string of substantial length, patterns that will allow me to break that string up into components of structure. This question is related to a biological sequence where in DNA there are…

kajendiran
- 39
- 5
1
vote
0 answers
How can I find the right most occurence with the Boyer Moore algorithm?
I have to implement Boyer Moore, but it has to find the right most occurrence. (So a reverse version of Boyer Moore). Returns index of the right most location where the patterns occurs within the text. Searching * starts at the right end side of the…

Tony Stark
- 45
- 1
- 8
1
vote
1 answer
Find lines in one Object based on strings in other object
Finding lines in one file based on rows in another file.
I have one object $A with some rows like:
0c7d3283-bec2-4db1-9078-ebb79d21afdf
200bc957-26dd-4e8e-aa6e-00dc357c4ac2
218e0d2a-0e8b-4a68-8136-8f5dd749a614
I want to find matches in object $B…

marcel uitnederland
- 13
- 5
1
vote
1 answer
Finding most similar Range in an Array
I am finding A[i..j] that is the most similar to B.
Here calcSimilarity is function that returns similarity of two arrays.
Similarity is calculated as
Not than brute force search, I want to know what kind of data structure and algorithm is…

artgb
- 3,177
- 6
- 19
- 36
1
vote
2 answers
Check every string in textfile for substring
I've searched a long time and didn't find something useful for my problem. It may sound simple, I would be very happy if somebody could help me:
I want to write a batch script, which proves every string in a textfile whether it contains a specific…

bianconero
- 215
- 1
- 12
1
vote
1 answer
Solr query not working for inputs with spaces though the output from analysis phase seems fine for it to work
I'm stuck up with an issue as elaborated here. I have a text field that stores bed and bath info into it, while indexing I store values like 2b 3bt for 2 beds and 3 baths respectively.
Finally I need to support queries like "2 beds 3 baths" , "beds…

Suresh
- 41
- 5
0
votes
2 answers
Searching for matching attributes
My special objects have one list of attribute-values (that is a varying list of abbreviated strings of short but differing length meaning some capabilities of any object) → ['A', 'B', 'AC', 'BC', ...]
running the program I'm searching for at least…

Berthold
- 15
- 4
0
votes
2 answers
Finding a pattern in a binary matrix with R
I have a nxn symetrical binary matrix and I want to find the largest rectangle (area) with 0 at the top-left and bottom-right corners and 1 at the top-right and bottom-left corner. If I just do it with loops, checking all the rectangles from the…
0
votes
0 answers
Is there any way to count how many time specific patterns occurred in DataFrame?
I have DataFrame which looks like this :
A B
0 10 jacket
1 10 T-shirt
2 20 jacket
3 20 hoodie
4 10 jacket
5 10 T-shirt
6 20 jacket
7 20 hoodie
.
.
.
It is obviously clear that there is a…
user14976825
0
votes
1 answer
How to find patterns between numerious causes and the result in python?
For each instance I have a set of problems and a result, like this:
df = pd.DataFrame({
"problems": [[1,2,3], [1,2,4], [1,4,5], [3,4,5], [1,5,6]],
"results": ["A", "A", "C", "C", "A"]
})
I want to find patterns in the relationship between…

Julian
- 591
- 5
- 14
0
votes
2 answers
How can i find a pattern in an array of integers?
A week ago I got my homework, where I have to write a function in C.
The function gets a single array of positive integers, and it has to return the next number in the array.
The arrays look something like this:…

Balázs Szombati
- 1
- 1
- 1
0
votes
1 answer
How to find a sequence of numbers in an array in R?
I want to find a specific sequence of numbers in an array. As an example, suppose I want to find the sequence of two numbers 7, i.e., c(7,7).
Take matrix M, where
set.seed(100)
M = matrix(sample(10,100,replace = T), nrow = 10)
If you run the…

Jxson99
- 347
- 2
- 16
0
votes
1 answer
Java, How can I find a pattern in a File and read the whole line?
I want to find a special charsequence in a file and I want to read the whole line where the occurrences are.
The following code just checks the first line and fetchess this ( the first ) line.
How can I fix it?
Scanner scanner = new…

rootBoy
- 1
- 1
- 1