Unlock instant, AI-driven research and patent intelligence for your innovation.

Method for matching character string patterns

A pattern matching and string technology, applied in the field of string retrieval, can solve the problems of singleness, cumbersome implementation, and inability to achieve the effect of moving pattern strings.

Active Publication Date: 2017-10-03
深圳市乐宜科技有限公司
View PDF5 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The good suffix method of the Boyer-Moore algorithm is cumbersome to implement
[0005] The Horspool algorithm improves the bad character method of the Boyer-Moore algorithm, but it is relatively simple, and sometimes it cannot achieve a better effect of moving pattern strings

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for matching character string patterns
  • Method for matching character string patterns

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0060] see Figure 1-2 , in the embodiment of the present invention: a method for string pattern matching, the method only retrieves the position where the pattern string first appears in the text string, and retrieves all the pattern strings from the text string, the method is the same; the complete scheme is as follows :

[0061] The first step: Assumption: the text string X is: x 1 x 2 x 3 ... x n , the pattern string Y is: y 1 the y 2 the y 3 ...y ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for matching character string patterns. The method includes acquiring M1 by bad character movement rules in pattern string retrieval procedures and acquiring M2 by end character movement rules in the pattern string retrieval procedures. The maximum values of the M1 and the M2 are the maximum movable distances of pattern strings. Compared with the traditional KMP (Knuth-Morris-Pratt) algorithms, Horspool algorithms and Boyer-Moore algorithms, the method has the advantages that excellent pattern string movement effects can be realized, retrieval means are abundant and changeable, occurrence locations of pattern strings in text strings can be quickly positioned, the method has efficient character string retrieval functions, and accordingly the experience of users can be enhanced.

Description

technical field [0001] The invention relates to the technical field of character string retrieval, in particular to a method for character string pattern matching. Background technique [0002] String retrieval has a wide range of applications in real life. How to efficiently locate the content you want to find from a large piece of text is very necessary. Nowadays, there are also some algorithms, such as KMP algorithm, Horspool algorithm, Boyer-Moore algorithm, etc., which are well known to everyone. The time complexity of each algorithm varies according to the specific situation, but the ultimate goal is to retrieve the content with the fewest steps. That is, when the string to be retrieved is not matched each time, ignore as many characters as possible and continue to retrieve backwards. [0003] The KMP algorithm is a left-to-right matching process, which is not as efficient as right-to-left matching in many cases. In the process of matching from right to left, there...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
CPCG06F16/33G06F16/90344
Inventor 周聪伟
Owner 深圳市乐宜科技有限公司