Similar character string detection device, method, program, and system

The method enhances the detection of similar character strings by calculating scores based on common substring lengths, addressing the challenge of word order changes in existing distance metrics, thereby improving accuracy.

JP7615608B2Active Publication Date: 2025-01-17RESONAC CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2020178242
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-10-23
Publication Date
2025-01-17
Estimated Expiration
2040-10-23

AI Technical Summary

Technical Problem

Existing methods like Levenshtein and Jaro-Winkler distance struggle to accurately detect similar character strings when the word order of multiple words is switched, such as in '50% solution' and 'solution (50%)', judging them as completely different strings.

Method used

A method that calculates a first score by dividing the sum of common character string lengths by the longer length and a second score by the shorter length, with the output unit determining similar character strings based on these scores, focusing on the longest common substring length.

Benefits of technology

Improves the accuracy of detecting similar character strings, especially when word order is switched, by using the first and second score calculations to identify swapped or omitted words effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007615608000011
    Figure 0007615608000011
  • Figure 0007615608000012
    Figure 0007615608000012
  • Figure 0007615608000013
    Figure 0007615608000013
Patent Text Reader

Abstract

To provide a similar character string detection apparatus, method, program, and system capable of improving the accuracy of detection of similar character strings.SOLUTION: In a similar character string detection system, a similar character string detection apparatus 10 comprises: a first score calculation unit 104 for calculating a first score by dividing the sum of each length of common character parts between a first character string and a second character string by the longer one of either the first character string length or the second character string length; a second score calculation unit 105 for calculating a second score by dividing the number of characters of the longest common part between the first character string and the second character string by the shorter one of either the first character string length or the second character strings length; and an output unit 107 for outputting a combination of similar character strings based on the first score or the second score.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a similar string detection device, method, program, and system. [Background technology]

[0002] Conventionally, a method for detecting a character string similar to a given character string from among multiple character strings is known (Patent Document 1). Examples of similarity measures used in detecting similar character strings include the Levenshtein distance and the Jaro-Winkler distance.

[0003] The Levenshtein distance measures similarity by the number of edits (insertion, deletion, or substitution of a single character) required to make one string into the other. The Jaro-Winkler distance measures similarity by the number of characters that match between the strings and whether or not substitutions were necessary. Therefore, the Levenshtein and Jaro-Winkler distance methods are suitable for detecting strings that have slight differences (e.g., only one character difference) due to typos, etc. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2018-36744 A Summary of the Invention [Problem to be solved by the invention]

[0005] However, it is difficult to detect strings in which the order of multiple words is reversed using the Levenshtein distance and the Jaro-Winkler distance methods. For example, suppose there are strings "50% solution" and "solution (50%)". "50% solution" and "solution (50%)" have the same meaning, that is, they should be judged as similar. However, the Levenshtein distance and the Jaro-Winkler distance methods judge strings in which the order of multiple words is reversed as completely different strings.

[0006] Therefore, an object of the present invention is to improve the accuracy of detecting similar character strings. [Means for solving the problem]

[0007] [1] a first score calculation unit that calculates a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by the longer of the length of the first character string and the length of the second character string; an output unit that outputs a combination of similar character strings based on the first score; A similar character string detection device comprising: [2] further comprising a second score calculation unit that calculates a second score by dividing the longest number of characters in a portion common to the first character string and the second character string by the shorter of a length of the first character string and a length of the second character string; The similar string detection device according to [1], wherein the output unit outputs a combination of similar strings based on the second score. [3] The similar string detection device according to [1], wherein the length of each of the common strings between the first string and the second string is 2 or more. [4] The similar string detection device according to [2], wherein the longest number of characters in the common portion between the first string and the second string is the length of a continuous string. [5] A computer-implemented method comprising the steps of: Calculating a first score by dividing the sum of the lengths of the common character strings between a first character string and a second character string by the longer of the length of the first character string and the length of the second character string; outputting a combination of similar character strings based on the first score; The method includes: [6] Computers, a first score calculation unit that calculates a first score by dividing the sum of lengths of character strings common to a first character string and a second character string by the longer of the length of the first character string and the length of the second character string; an output unit that outputs a combination of similar character strings based on the first score; A program to function as a [7] A system including a similar string detection device and a user terminal, The similar character string detection device comprises: a first score calculation unit that calculates a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by the longer of the length of the first character string and the length of the second character string; an output unit that outputs a combination of similar character strings based on the first score, The user terminal, The system displays the similar string combinations. Effect of the Invention

[0008] According to the present invention, the accuracy of detecting similar character strings can be improved. [Brief description of the drawings]

[0009] [Figure 1] 1 is a diagram showing an overall system configuration including a similar string detection device according to an embodiment of the present invention. [Diagram 2] 1 is a diagram showing functional blocks of a similar string detection device according to an embodiment of the present invention. [Diagram 3]10 is a flowchart showing the flow of similar string detection processing according to an embodiment of the present invention. [Figure 4] 13 is a flowchart showing a flow of a first score calculation process according to one embodiment of the present invention. [Diagram 5] 13 is a flowchart showing a flow of a second score calculation process according to one embodiment of the present invention. [Figure 6] 11 is a flowchart showing the flow of a common substring length calculation process according to an embodiment of the present invention. [Figure 7] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 8] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 9] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 10] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 11] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 12] FIG. 11 is a diagram for explaining a calculation of a common substring length according to an embodiment of the present invention. [Figure 13] FIG. 11 is a diagram for comparing the accuracy of similar string detection. [Figure 14] FIG. 11 is a diagram for comparing the accuracy of similar string detection. [Figure 15] FIG. 11 is a diagram for comparing the accuracy of similar string detection. [Figure 16] 1 is a diagram illustrating a hardware configuration of a similar string detection device and a user terminal according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, each embodiment will be described with reference to the accompanying drawings. In this specification and the drawings, components having substantially the same functional configurations are denoted by the same reference numerals, and redundant description will be omitted.

[0011] <Terminology explanation> A "character string" is a sequence of one or more characters. A "string group" is a collection of multiple strings.

[0012] In this embodiment, a comparison is described for a case where strings contained in two string groups (hereinafter referred to as string group 1 and string group 2) (i.e., strings contained in string group 1 and string group 2) are compared. String group 1 and string group 2 may be different string groups or may be the same string group. However, this embodiment can also be applied to a case where a string specified by a user or the like is compared with a string contained in a certain string group.

[0013] <System configuration> Fig. 1 is a diagram showing an overall system configuration including a similar string detection device 10 according to one embodiment of the present invention. As shown in Fig. 1, the similar string detection system 1 includes the similar string detection device 10 and a user terminal 20. The similar string detection device 10 can transmit and receive data to and from the user terminal 20 via any network. Each of them will be described below.

[0014] The similar string detection device 10 is a device (e.g., a server) that performs a process of detecting similar strings (hereinafter also referred to as "similar strings"). Specifically, the similar string detection device 10 detects strings similar to a certain string from a group of strings.

[0015] The user terminal 20 is a terminal used by a user who wants the similar string detection device 10 to detect similar strings. Specifically, the user terminal 20 accepts the specification of a group of strings input by the user. The user terminal 20 also notifies the accepted specification of the group of strings to the similar string detection device 10. For example, the user terminal 20 is a personal computer or the like.

[0016] The similar string detection device 10 may have some or all of the functions of the user terminal 20.

[0017] <Function block> The similar string detection device 10 includes a first score calculation unit 104 and an output unit 107. The similar string detection device 10 will be described in detail below with reference to FIG.

[0018] Fig. 2 is a diagram showing functional blocks of a similar string detection device 10 according to an embodiment of the present invention. As shown in Fig. 2, the similar string detection device 10 can include a string group acquisition unit 101, a string selection unit 102, a common substring length calculation unit 103, a first score calculation unit 104, a second score calculation unit 105, a similar string detection unit 106, and an output unit 107. Each of these units is realized by a process executed by a CPU of the similar string detection device 10 by a program installed in the similar string detection device 10. Each unit will be described below.

[0019] The string group acquiring unit 101 acquires two string groups (assumed to be string group 1 and string group 2) to be compared. For example, the string group acquiring unit 101 acquires two string groups designated by a user on the user terminal 20. Note that each string group may be stored in the similar string detection device 10 or may be stored outside the similar string detection device 10.

[0020] The character string selection unit 102 selects one character string each from each of the character string groups acquired by the character string group acquisition unit 101 (that is, from each of the character string groups 1 and 2).

[0021] Common portion character string length calculation unit 103 calculates the length of a character string common to the two character strings selected by character string selection unit 102 (hereinafter, also referred to as "common portion character string length").

[0022] The first score calculation unit 104 uses the result calculated by the common portion string length calculation unit 103 to calculate a first score.

[0023] The second score calculation unit 105 uses the result calculated by the common portion string length calculation unit 103 to calculate a second score.

[0024] The similar string detection unit 106 detects similar strings based on the scores calculated by the first score calculation unit 104 or the second score calculation unit 105. Only the first score may be used, or both the first score and the second score may be used. For example, the similar string detection unit 106 detects combinations of strings (i.e., combinations of similar strings) in descending order of score.

[0025] The output unit 107 outputs (for example, displays on the user terminal 20, stores in the similar string detection device 10, etc.) the similar strings detected by the similar string detection unit 106. For example, the output unit 107 outputs combinations of strings (i.e., combinations of similar strings) in descending order of scores.

[0026] <Processing method> FIG. 3 is a flowchart showing the flow of similar string detection processing according to one embodiment of the present invention.

[0027] In step 1 (S1), the string group acquiring unit 101 acquires two string groups (hereinafter referred to as string group 1 and string group 2) to be compared.

[0028] In step 2-1 (S2-1), the string selection unit 102 selects an unprocessed string from the string group 1 acquired in S1. The i-th string in the string group 1 is denoted as S1i.

[0029] In step 2-2 (S2-2), the string selection unit 102 selects an unprocessed string from the string group 2 acquired in S1. The j-th string in the string group 2 is denoted as S2j.

[0030] In step 3 (S3), common portion string length calculation unit 103 and first score calculation unit 104 (or second score calculation unit 105) calculate scores. Specifically, common portion string length calculation unit 103 and first score calculation unit 104 (or second score calculation unit 105) calculate the scores of S1i and S2j.

[0031] In step 4 (S4), first score calculation unit 104 or second score calculation unit 105 judges whether or not the scores of all character strings included in character string set 2 have been calculated. If the scores have been calculated, the process proceeds to step 5. If the scores have not been calculated, the process returns to step 2-2, and character string selection unit 102 adds 1 to j and selects the j+1th character string from character string set 2.

[0032] In step 5 (S5), the similar string detection unit 106 stores one or more strings with high scores (for example, the string with the highest score) from among the strings included in the string set 2 as a string corresponding to S1i.

[0033] In step 6 (S6), first score calculation unit 104 or second score calculation unit 105 judges whether or not the scores of all character strings included in character string set 1 have been calculated. If the scores have been calculated, the process proceeds to step 7. If the scores have not been calculated, the process returns to step 2-1, and character string selection unit 102 adds 1 to i and selects the (i+1)th character string from character string set 1.

[0034] In step 7 (S7), the similar string detection unit 106 detects similar strings based on the scores. Note that only the first score may be used, or both the first score and the second score may be used. For example, the similar string detection unit 106 detects combinations of strings (i.e., combinations of similar strings) in descending order of score.

[0035] In step 8 (S8), the output unit 107 outputs the similar strings detected in S5 and S7.

[0036] Next, a detailed explanation will be given of S3 in Fig. 3. Fig. 4 is a flowchart showing the flow of the first score calculation process according to one embodiment of the present invention.

[0037] In step 11 (S11), common portion string length calculation unit 103 calculates the common portion string length of S1i (the i-th string in string group 1) and S2j (the j-th string in string group 2). If there are multiple common strings between S1i and S2j, the string length of each string is calculated as the common portion string length. Therefore, multiple common portion string lengths can be calculated.

[0038] In step 12 (S12), first score calculation unit 104 divides the sum of the common substring lengths calculated in S11 by the longer of the length of S1i (the i-th string in string group 1) and the length of S2j (the j-th string in string group 2). First score calculation unit 104 determines the value obtained by dividing the sum of the common substring lengths by the longer of the length of S1i and the length of S2j as a first score. A larger first score indicates that the strings are more similar.

[0039] FIG. 5 is a flowchart showing the flow of the second score calculation process according to one embodiment of the present invention.

[0040] In step 21 (S21), common portion string length calculation unit 103 calculates the common portion string length of S1i (the i-th string in string group 1) and S2j (the j-th string in string group 2). As in S11, multiple common portion string lengths can be calculated.

[0041] In step 22 (S22), second score calculation unit 105 divides the longest common substring length (hereinafter also referred to as "longest common substring length") among the common substring lengths calculated in S21 by the shorter of the length of string S1i (the i-th string in string group 1) and the length of string S2j (the j-th string in string group 2). Second score calculation unit 105 determines the value obtained by dividing the longest common substring length by the shorter of the length of string S1i and the length of string S2j as the second score. A larger second score indicates that the strings are more similar.

[0042] Note that instead of the above-mentioned longest common subcharacter string length, a longest common subsequence length may be used. The longest common subsequence length is the number of characters common to two character strings, and these characters do not need to be consecutive.

[0043] Next, details of S11 in Fig. 4 and S21 in Fig. 5 will be described. Fig. 6 is a flowchart showing the flow of common portion string length calculation processing according to one embodiment of the present invention. As shown in Fig. 7, a table for storing data is used in which the number of columns is the length of character string S1 + 1 and the number of rows is the length of character string S2 + 1. Common portion string length calculation unit 103 assigns each character of character string S1 starting from the second column from the left. Common portion string length calculation unit 103 also assigns each character of character string S2 starting from the second row from the top.

[0044] In step 101 (S101), common substring length calculation unit 103 initializes the longest substring length to 0. Specifically, common substring length calculation unit 103 sets the values ​​of each column in the first row (top row) and each row in the first column (leftmost column) to 0. In other words, the longest substring length at this point is 0.

[0045] Common portion string length calculation unit 103 starts searching from the first characters of strings S1 and S2. i indicates that it is the i-th character from the first character of string S1. j indicates that it is the j-th character from the first character of string S2. The search is performed from i=0, j=0 (i.e., the first character).

[0046] In step 102 (S102), common substring length calculation unit 103 determines whether the i-th character of string S1 is equal to the j-th character of string S2. If they are equal, proceed to step 103, and if they are not equal, proceed to step 104. In step 104 (S104), common substring length calculation unit 103 inputs 0 into the box in the j+1th row and i+1th column of the table, and proceeds to step 105.

[0047] In step 103 (S103), common substring length calculation unit 103 inputs the value obtained by adding 1 to the value in the box in row j and column i to the box in row j+1 and column i+1 of the table. If the value is greater than the longest substring length at that point in time, the value is updated as the longest substring length.

[0048] In step 105 (S105), the common portion character string length calculation unit 103 judges whether the search has been completed up to the rear end character of the character string S1. If the search has been completed up to the rear end character, the process proceeds to step 106, and if the search has not been completed up to the rear end character, the process adds 1 to i and returns to S102.

[0049] In step 106 (S106), the common portion character string length calculation unit 103 judges whether the search has been completed up to the rear end character of the character string S2. If the search has been completed up to the rear end character, the process ends, and if the search has not been completed up to the rear end character, the process adds 1 to j and returns to S102.

[0050] The comparison of all characters is completed by the processes of S101 to S106. In the table, the common substring length is the value of the cell in which the bottom right cell is 0, or the cell in which there is no bottom right cell and in which a value other than 0 is entered. The longest common substring length is the largest value among the values ​​entered in the table.

[0051] <Common substring length calculation> 7 to 12 are diagrams for explaining a calculation of a common substring length according to an embodiment of the present invention. Suppose that a comparison is made between two strings, a string S1 "ABCDEFG" and a string S2 "AbcDE".

[0052] As shown in Figs. 7 to 12, a data storage table is used in which the number of columns is the length of character string S1 + 1 (in this example, the length of "ABCDEFG": 7 plus 1 = 8) and the number of rows is the length of character string S2 + 1 (in this example, the length of "AbcDE": 5 plus 1 = 6). Starting from the second column from the left, each character of character string S1 (in this example, "A", "B", "C", "D", "E", "F", "G") is assigned. Also, starting from the second row from the top, each character of character string S2 (in this example, "A", "b", "c", "D", "E") is assigned.

[0053] First, initialize the longest substring length to 0. Specifically, set the values ​​of each column in the first row (top row) and each row in the first column (leftmost column) to 0. In other words, the longest substring length at this point is 0.

[0054] Below, the values ​​resulting from comparing each character in the two strings are entered into the cells where the compared characters intersect. Specifically, if the two characters are equal, the value of the cell to the top left of the cell where the compared characters intersect plus 1 is entered into the cell where the compared characters intersect. If the two characters are not equal, 0 is entered into the cell where the compared characters intersect. When a value greater than the current longest substring length is entered, that value is updated as the longest substring length.

[0055] First, the first character of each string (in this example, "A" in string S1 and "A" in string S2) is compared. In this example, the two are equal, so the value of the cell to the top left of the cell where the compared characters intersect is added by 1 and entered into the cell where the compared characters intersect (see Figure 7).

[0056] Next, the first character of one string is compared with the second and subsequent characters of the other string. First, in this example, the second character "B" of string S1 is compared with the first character "A" of string S2. In this example, since the two are not equal, a 0 is entered into the cell where the compared characters intersect (see Figure 8). The same process is repeated until the comparison of each character in string S1 with the first character of string S2 is completed (see Figure 9).

[0057] Next, the second character of one string is compared with each character of the other string. First, in this example, the first character "A" of string S1 is compared with the second character "b" of string S2. In this example, since the two are not equal, a 0 is entered into the cell where the compared characters intersect (see Figure 10). The same process is repeated until the comparison of each character of string S1 with the second character of string S2 is completed (see Figure 11).

[0058] In this way, the values ​​resulting from comparing each character of the two strings are entered into the cells where the characters intersect. In FIG. 12, comparison of all characters has been completed. The common substring length is the value of the cell where the bottom right cell is 0, or where there is no bottom right cell and where a value other than 0 has been entered (in the example of FIG. 12, "1" in the cell where A intersects with A, and "2" in the cell where E intersects with E). That is, in the example of FIG. 12, the sum of the common substring lengths is 3 (the sum of "1" and "2"). Also, the longest common substring length is the largest value entered in the table (2 in the example of FIG. 12).

[0059] By using the method described in FIG. 7 to FIG. 12, the common part character string length can be calculated at high speed. Suppose that two character strings, character string S1 and character string S2, are compared. The length of each character string is expressed as follows:

[0060]

number

[0061]

number

[0062]

number

[0063]

number

[0064]

number

[0065]

number

[0066]

number

[0067]

number

[0068]

number

[0069]

number

[0070] <Other embodiments> When calculating score 1, a restriction may be placed on the length of the common substring. Specifically, common substrings with a length of 1 are excluded. For example, in the tables described in FIG. 7 to FIG. 12, the value of the top left cell with a value of 1 or more (and the bottom right cell with a value of 0, or the bottom right cell does not exist and a value other than 0 is input) is set as the common substring length, so that common substrings with a length of 1 can be excluded. When a common substring with a length of 1 is used, the similarity between strings S1 and S2 containing one common character increases. By eliminating common substrings with a length of 1, a score specialized for word replacement can be calculated. Note that when many strings are composed of a small number of characters, such as 2 to 5 characters, it is more useful to include common substrings with a length of 1.

[0071] [Example] <Accuracy of similar string detection> Hereinafter, the accuracy of similar string detection based on this embodiment will be described as an example. Figures 13 to 15 are diagrams for comparing the accuracy of similar string detection. Four methods, namely, the Levenshtein distance and the Jaro-Winkler distance, which are conventional techniques, the first score and the second score of the present invention, are compared.

[0072] The smaller the Levenshtein distance, the more similar the strings are. In this comparison, however, the Levenshtein distance was standardized by dividing the value by the longer of the lengths of the two strings.

[0073] The larger the Jaro-Winkler distance, the more similar the strings are.

[0074] As described above, the larger the first score and the second score, the more similar the character strings are.

[0075] <<Comparison 1>> Figure 13 shows the results of comparison 1 of the accuracy of similar string detection. The top row shows the similarity between string 1 "Product 1 Evaluation Recipe (spaces are full-width spaces)" and string 2 "Evaluation Recipe Product 1 (spaces are half-width spaces)", and the bottom row shows the similarity between string 1 "Product 1 Evaluation Recipe (spaces are full-width spaces)" and string 3 "Recipe Product 2 (spaces are half-width spaces)". In order to determine that strings in which the word order of multiple words is switched are similar, string 1 and string 2 should be determined to be more similar than string 1 and string 3. The results of comparison 1 show that the first score is appropriate.

[0076] <<Comparison 2>> Figure 14 shows the results of comparison 2 of the accuracy of similar string detection. The top row shows the similarity between string 1 "Evaluation recipe Product 1 (spaces are half-width spaces)" and string 2 "Product 1 Evaluation recipe (spaces are full-width spaces)", and the bottom row shows the similarity between string 1 "Evaluation recipe Product 1 (spaces are half-width spaces)" and string 3 "Recipe Product 2 (spaces are half-width spaces)". In order to determine that strings in which the word order of multiple words is switched are similar, string 1 and string 2 should be determined to be more similar than string 1 and string 3. The results of comparison 2 show that the first score is appropriate.

[0077] <<Comparison 3>> Figure 15 shows the results of comparison 3 of the accuracy of similar string detection. The top row shows the similarity between string 1 "Product 1 evaluation recipe (spacing is half-width spaces)" and string 2 "Product 1 evaluation (spacing is half-width spaces)", and the bottom row shows the similarity between string 1 "Product 1 evaluation recipe (spacing is half-width spaces)" and string 3 "Product 2 evaluation recipe (spacing is half-width spaces)". In order to determine that a string in which words are not omitted and a string in which words are omitted are similar, string 1 and string 2 should be determined to be more similar than string 1 and string 3. The results of comparison 3 show that the second score is appropriate.

[0078] <Effects> In this way, in one embodiment of the present invention, character strings in which the word order of a plurality of words has been changed can be determined to be similar, and therefore a character string in which the word order of a plurality of words has been changed can be detected from an original character string. Also, in one embodiment of the present invention, a character string in which words are not omitted and a character string in which words are omitted can be determined to be similar, and therefore a character string in which words are omitted (or a character string in which words are not omitted) can be detected from an original character string.

[0079] <Hardware configuration> 16 is a hardware configuration diagram of a similar string detection device 10 and a user terminal 20 according to an embodiment of the present invention. The similar string detection device 10 and the user terminal 20 have a CPU (Central Processing Unit) 1001, a ROM (Read Only Memory) 1002, and a RAM (Random Access Memory) 1003. The CPU 1001, the ROM 1002, and the RAM 1003 form a so-called computer.

[0080] Furthermore, the similar string detection device 10 and the user terminal 20 may include an auxiliary storage device 1004 , a display device 1005 , an operation device 1006 , an I / F (Interface) device 1007 , and a drive device 1008 .

[0081] The hardware components of the similar string detection device 10 and the user terminal 20 are connected to each other via a bus B.

[0082] The CPU 1001 is a computing device that executes various programs installed in the auxiliary storage device 1004 .

[0083] The ROM 1002 is a non-volatile memory. The ROM 1002 functions as a main storage device that stores various programs, data, etc. required for the CPU 1001 to execute various programs installed in the auxiliary storage device 1004. Specifically, the ROM 1002 functions as a main storage device that stores boot programs such as a BIOS (Basic Input / Output System) and an EFI (Extensible Firmware Interface).

[0084] The RAM 1003 is a volatile memory such as a dynamic random access memory (DRAM) or a static random access memory (SRAM). The RAM 1003 functions as a main storage device that provides a working area in which various programs installed in the auxiliary storage device 1004 are expanded when the CPU 1001 executes them.

[0085] The auxiliary storage device 1004 is an auxiliary storage device that stores various programs and information used when the various programs are executed.

[0086] The display device 1005 is a display device that displays the internal state of the similar string detection device 10 and the user terminal 20, etc.

[0087] The operation device 1006 is an input device through which a person operating the similar string detection device 10 and the user terminal 20 inputs various instructions to the similar string detection device 10 and the user terminal 20 .

[0088] The I / F device 1007 is a communication device for connecting to a network and communicating with other devices.

[0089] The drive device 1008 is a device for setting the storage medium 1009. The storage medium 1009 here includes media that record information optically, electrically, or magnetically, such as a CD-ROM, a flexible disk, a magneto-optical disk, etc. The storage medium 1009 may also include semiconductor memories that record information electrically, such as an EPROM (Erasable Programmable Read Only Memory), a flash memory, etc.

[0090] The various programs to be installed in the auxiliary storage device 1004 are installed, for example, by setting the distributed storage medium 1009 in the drive device 1008 and reading out the various programs recorded in the storage medium 1009 by the drive device 1008. Alternatively, the various programs to be installed in the auxiliary storage device 1004 may be installed by being downloaded from a network via the I / F device 1007.

[0091] Although the embodiments of the present invention have been described in detail above, the present invention is not limited to the specific embodiments described above, and various modifications and variations are possible within the scope of the gist of the present invention as defined in the claims. [Explanation of symbols]

[0092] 1. Similar String Detection System 10. Similar String Detection Device 20 User terminal 101 String group acquisition part 102 String selection section 103 Common substring length calculation section 104 First Score Calculation Unit 105 Second Score Calculation Section 106 Similar String Detection Unit 107 Output section 1001 CPU 1002 ROM 1003 RAM 1004 Auxiliary storage device 1005 Display device 1006 Operating device 1007 I / F device 1008 Drive device 1009 Storage medium

Claims

1. a first score calculation unit that calculates a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by a longer length of the first character string and the second character string; an output unit that outputs a combination of similar character strings based on the first score; Equipped with The first score calculation unit, In a table having a number of columns equal to the length of the first character string plus 1 and a number of rows equal to the length of the second character string plus 1, the top row and the leftmost column are set to 0; assigning each character of the first character string in order from the second column from the left end, and assigning each character of the second character string in order from the second row from the top end; If the character of the first character string and the character of the second character string are not equal, input 0 into the cell where the compared characters intersect, and if the character of the first character string and the character of the second character string are equal, input into the cell where the compared characters intersect a value obtained by adding 1 to the value of the cell to the upper left of the cell where the compared characters intersect; A similar string detection device that determines the length of each of the common strings as the value of a cell whose bottom right cell is 0, or a cell that does not exist and has a value other than 0 input.

2. a second score calculation unit that calculates a second score by dividing the longest number of characters in a portion common to the first character string and the second character string by a shorter length of the first character string and the second character string, The similar string detection device according to claim 1 , wherein the output unit outputs a combination of similar strings based on the second score.

3. 2. The similar string detection device according to claim 1, wherein each of the character strings common to the first string and the second string has a length of two or more.

4. 3. The similar string detection device according to claim 2, wherein the longest number of characters in the common portion between the first string and the second string is a length of a continuous string of characters.

5. The similar string detection device as described in claim 1, wherein a string common to the first string and the second string is excluded if its length is 1.

6. 1. A computer-implemented method comprising: calculating a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by the longer of a length of the first character string and a length of the second character string; outputting a combination of similar character strings based on the first score; Including, In the step of calculating the first score, In a table having a number of columns equal to the length of the first character string plus 1 and a number of rows equal to the length of the second character string plus 1, the top row and the leftmost column are set to 0; assigning each character of the first character string in order from the second column from the left end, and assigning each character of the second character string in order from the second row from the top end; If the character of the first character string and the character of the second character string are not equal, input 0 into the cell where the compared characters intersect, and if the character of the first character string and the character of the second character string are equal, input into the cell where the compared characters intersect a value obtained by adding 1 to the value of the cell to the upper left of the cell where the compared characters intersect; A method in which the value of a cell whose bottom right cell is 0, or a cell that does not exist bottom right and has a value other than 0 input, is set as the length of each of the common character strings.

7. Computer, a first score calculation unit that calculates a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by a longer length of the first character string and the second character string; an output unit that outputs a combination of similar character strings based on the first score; Functioning as a The first score calculation unit, In a table having a number of columns equal to the length of the first character string plus 1 and a number of rows equal to the length of the second character string plus 1, the top row and the leftmost column are set to 0; assigning each character of the first character string in order from the second column from the left end, and assigning each character of the second character string in order from the second row from the top end; If the character of the first character string and the character of the second character string are not equal, input 0 into the cell where the compared characters intersect, and if the character of the first character string and the character of the second character string are equal, input into the cell where the compared characters intersect a value obtained by adding 1 to the value of the cell to the upper left of the cell where the compared characters intersect; A program that sets the value of a cell whose bottom right cell is 0, or a cell that does not exist bottom right and has a value other than 0 entered, as the length of each of the common character strings.

8. A system including a similar string detection device and a user terminal, The similar character string detection device comprises: a first score calculation unit that calculates a first score by dividing a sum of lengths of character strings common to a first character string and a second character string by a longer length of the first character string and the second character string; an output unit that outputs a combination of similar character strings based on the first score, The first score calculation unit, In a table having a number of columns equal to the length of the first character string plus 1 and a number of rows equal to the length of the second character string plus 1, the top row and the leftmost column are set to 0; assigning each character of the first character string in order from the second column from the left end, and assigning each character of the second character string in order from the second row from the top end; If the character of the first character string and the character of the second character string are not equal, input 0 into the cell where the compared characters intersect, and if the character of the first character string and the character of the second character string are equal, input into the cell where the compared characters intersect a value obtained by adding 1 to the value of the cell to the upper left of the cell where the compared characters intersect; The value of a cell whose bottom right cell is 0 or a cell whose bottom right cell does not exist and into which a value other than 0 is input is set as the length of each of the common character strings; The user terminal, The system displays the similar string combinations.

Citation Information

Patent Citations

  • Key ward collation / Retrieval processing method

    JP1994314307A

  • Information retrieving method and system

    JP1996147320A

  • Device and method for retrieving natural language instance

    JP1997245051A

  • Similar character string detector, method for detecting similar character string, and similar character string detection program

    JP2018036744A

  • Data processing device, data processing method and data processing program

    JP2019168758A