Method and system for efficiently storing and retrieving cross-language text data and storage medium
By constructing structure trees and multi-dimensional linear linked lists, the large amount of text data and storage space occupation caused by changes in the emotional intention of the expressor are solved, and efficient storage and retrieval of cross-language text data is achieved.
Patent Information
- Application Number
- CN202411590583.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art is difficult to efficiently store and retrieve problems such as large amount of text data, a lot of storage space, and low scalability due to changes in the emotional intention of the expressor.
By dividing sentences according to structure, building a structure tree; classifying part-of-speech texts according to grammatical structure to form a grammatical linear link list; storing the same part-of-speech texts in the same dimension linear link list to form a multi-dimensional linear link list; using Chinese as the search criteria to establish an N-dimensional linear link list, and putting different language representations of the same text into the same dimension linear link list to achieve efficient storage and retrieval.
It realizes efficient storage and retrieval of cross-language text data, overcomes the problems of large amount of text data, large storage space, low expansion and improvement caused by changes in the expressor's emotional intention.
Smart Images

Figure CN119537512A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data management, and more particularly to a method, system and storage medium for efficiently storing and retrieving cross-language text data. Background Art
[0002] Nowadays, in the field of data management, most researchers focus on the data storage and data application of text or sentence data, but there is less research on the storage and potential value of the text itself that constitutes text and sentences. Text is the basic unit of sentences and texts. These basic units are divided into nouns, pronouns, numerals, verbs, adjectives, adverbs, place names, festivals, names, dates, interjections and modal words according to their parts of speech. The grammatical structure of text, subject, predicate, object, predicate, attributive, adverbial, and complement is the key to the composition of sentences. Different sentences are divided into subject-predicate, subject-predicate-object, subject-predicate-double-object, subject-predicate-object-complement, and subject-copula-table according to their structure. The semantic relationship between sentences constitutes the text. Sentences and texts will change due to the fields to which the expresser belongs and the emotional intentions. This change directly affects the order of magnitude of sentences and texts, and indirectly affects the size requirements of the storage environment and the retrieval call speed.
[0003] Therefore, how to overcome the problems of large amount of text data, large storage space occupation, low scalability and improveability caused by changes in the expresser's emotional intention is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] In view of this, the present invention provides a method, system and storage medium for efficiently storing and retrieving cross-language text data, which solves the problems existing in the background technology.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for efficiently storing and retrieving cross-language text data comprises the following steps:
[0007] Divide different sentences according to their structure and construct a structure tree;
[0008] Classify different parts of speech characters according to the grammatical structure to form a grammatical linear list;
[0009] The same part-of-speech characters are stored in the same-dimensional linear linked list, and the part-of-speech is inferred in turn to form a multi-dimensional part-of-speech linear linked list with the part-of-speech category as the dimension;
[0010] An N-dimensional linear linked list is established based on Chinese as the retrieval basis, and different language representations of the same character are placed in the same-dimensional language linear linked list;
[0011] Based on the established grammar linear linked list, part of speech linear linked list and language linear linked list, the position of the text to be searched is obtained and the position information is output to complete the search operation.
[0012] Optional classification categories include: subject-predicate, subject-predicate-object, subject-predicate-double-object, subject-predicate-object complement, and subject-copula-predicate.
[0013] Optionally, in the structure tree, the root node is the subject, the child nodes of the subject are the transitive predicate, the intransitive predicate, and the copula; the child node of the transitive predicate is the direct object, the child nodes of the direct object are the indirect object and the object complement; the child node of the copula is the predicate; and the intransitive predicate has no child nodes.
[0014] Optionally, in the structure tree, each node stores the index value of the head node in a linear linked list of all parts of speech that can be used for the node.
[0015] Optionally, in the linear linked list of parts of speech, the part-of-speech sequences linked after the index values of different dimensions are fixed to distinguish the categories when the index values are the same.
[0016] Optionally, when forming a grammatical linear linked list, the first letter of the corresponding English word is obtained through a Chinese-English comparison table of part-of-speech categories, the position number of the first letter in the alphabet is determined, and the remainder of 26 is taken for the position number as the index value to store the part-of-speech category.
[0017] Optionally, in the linear linked list of languages, find the language expression of the corresponding text according to the order of the index values of each language; wherein the order of the index values of each language is the order of the position numbers of the first letters of the pinyin of different languages in the alphabetical table after taking the remainder of 26.
[0018] A system for efficiently storing and retrieving text data across languages, using any of the above methods for efficiently storing and retrieving text data across languages, comprising:
[0019] The division module is used to divide different sentences according to the structure of the sentences and construct a structure tree;
[0020] The first building module is used to classify different parts of speech characters according to the grammatical structure to which the characters belong, and form a grammatical linear linked list;
[0021] The second construction module is used to store the same part-of-speech characters in a same-dimensional linear linked list, and form a multi-dimensional part-of-speech linear linked list with part-of-speech categories as dimensions by analogy with the part-of-speech categories;
[0022] The third construction module is used to establish an N-dimensional linear linked list based on Chinese as the retrieval basis, and put different language representations of the same character into the same-dimensional language linear linked list;
[0023] The retrieval module is used to obtain the position of the text to be retrieved and output the position information according to the established grammar linear chain list, part of speech linear chain list and language linear chain list to complete the retrieval operation.
[0024] A computer storable medium stores a computer program, which, when executed by a processor, implements the steps of any of the above methods for efficiently storing and retrieving text data across languages.
[0025] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a method, system and storage medium for efficiently storing and retrieving cross-language text data, establishes a linear linked list that indexes different languages, parts of speech and grammars, achieves the effect of efficient storage and retrieval, and overcomes the problems of large amount of text data, large storage space occupied, low scalability and improveability caused by changes in the expresser's emotional intentions. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0027] Figure 1 A flow chart of the method for efficiently storing and retrieving cross-language text data provided by the present invention;
[0028] Figure 2 A schematic diagram of a structure tree provided by the present invention;
[0029] Figure 3 A linear linked list storage table corresponding to 26 letters of the part of speech provided by the present invention;
[0030] Figure 4 A linear linked list of specific parts of speech in the grammatical structure provided by the present invention;
[0031] Figure 5 A linear linked list of specific characters corresponding to each word class provided by the present invention;
[0032] Figure 6 The present invention provides a linear linked list in which the same text corresponds to different languages. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] The embodiment of the present invention discloses a method for efficiently storing and retrieving cross-language text data, such as Figure 1 As shown, the following steps are included:
[0035] Divide different sentences according to their structure and construct a structure tree;
[0036] Classify different parts of speech characters according to the grammatical structure to form a grammatical linear list;
[0037] The same part-of-speech characters are stored in the same-dimensional linear linked list, and the part-of-speech is inferred in turn to form a multi-dimensional part-of-speech linear linked list with the part-of-speech category as the dimension;
[0038] An N-dimensional linear linked list is established based on Chinese as the retrieval basis, and different language representations of the same character are placed in the same-dimensional language linear linked list;
[0039] Based on the established grammar linear linked list, part of speech linear linked list and language linear linked list, the position of the text to be searched is obtained and the position information is output to complete the search operation.
[0040] In a specific implementation, different sentences can be divided into five categories according to the structure of the sentences, including: subject-predicate, subject-predicate-object, subject-predicate-double-object, subject-predicate-object complement, and subject-copula-predicate.
[0041] The above five types of structures can be represented by the structure tree in the data structure, such as Figure 2 As shown, the root node is the subject, and the child nodes of the subject are the transitive predicate, the intransitive predicate, and the copula; the child node of the transitive predicate is the direct object, and the child nodes of the direct object are the indirect object and the object complement; the child node of the copula is the predicate; and the intransitive predicate has no child nodes.
[0042] In a specific implementation, each node in the structure tree stores the index value of the head node in the linear linked list of all parts of speech that can be used for the node. For example, the position number of the first letter of the English representation of "subject" among the 26 letters is taken as the remainder of 26 and stored in the linear list as the index value for easy retrieval and storage.
[0043] Specifically, the index value is obtained as follows:
[0044] (1) Subject: subject; first letter: s; s is the 19th letter among the 26 letters, i.e., index value: 19%26=19;
[0045] (2) Transitive predicate: predicate; first letter: p; p is the 16th among the 26 letters, i.e., the index value: 16%26=16;
[0046] (3) Direct object: direct object; first letter: d; d is the 4th of the 26 letters, i.e. the index value: 4%26=4;
[0047] (4) Linking verb; first letter: l; l is the 12th letter among the 26 letters, i.e., the index value is: 12%26=12;
[0048] (5) Predicative: predicative; first letter: p; p is the 16th among the 26 letters, i.e., index value: 16%26=16;
[0049] (6) complement: complement; first letter: c; c is the third among the 26 letters, i.e., index value: 3%26=3;
[0050] (7) Indirect object: indirect object; first letter: i; i is the 9th in the 26 letters, i.e. index value: 9%26=9;
[0051] (8) intransitive predicates; first letter: i; i is the 9th among the 26 letters, i.e., the index value: 9%26=9;
[0052] (9) Adverbial: adverbial; first letter: a; a is the first among the 26 letters, that is, the index value is: 1%26=1.
[0053] According to the above analysis, it can be seen that the first letters of "transitive predicate" and "predicative" are the same. Therefore, in order to solve the problem that the index is the same when the first letters are the same and the categories cannot be distinguished, it is necessary to carry not only the index value but also the corresponding data during the search process. In this embodiment, by fixing the part-of-speech sequence linked to the index values of different dimensions, the purpose of distinguishing categories can be achieved even when the index values are the same. As shown in Table 1 and Figure 3 As shown, i / I is in the 10th dimension of the 26-dimensional linear linked list, the first position it links to is the "indirect object" and the second is the "intransitive predicate".
[0054] Table 1 Linear table of part of speech
[0055]
[0056] Each specific grammatical structure category also has different classifications, such as: the parts of speech that can be used as subjects include nouns, pronouns, numerals, etc., the parts of speech of transitive predicates include developmental verbs and existential verbs, and intransitive predicates include action verbs and psychological verbs. The specific subcategories of other grammatical structures are shown in Table 2.
[0057] Table 2 Specific subdivision categories of grammatical structures
[0058]
[0059] In order to efficiently store the specific subdivided word classes of the above grammatical structure, this embodiment obtains the corresponding first letter of English through the Chinese-English comparison table of the word class, determines the position number of the first letter in the alphabet table, and takes the remainder of 26 as the index value to store the word class, as shown in Table 3 and Figure 4 shown.
[0060] Table 3 Index range of specific parts of speech in grammatical structures
[0061]
[0062]
[0063] In a specific implementation, a linear table is designed to store index intervals and data values of different categories of grammatical structures. The index interval in the table is a storage range of a specific part of speech (also the dimension of the linear linked list). For example, the index range of "noun" is "0-5000", so the dimension of the linear linked list of noun is 5001. The specific categories listed in the linear table shall prevail, as shown in Table 4.
[0064] Table 4 Description of different part-of-speech index value intervals
[0065]
[0066] Regarding the index interval value of "noun", the original number of nouns is 1 million. Since there are 16 other parts of speech, in order to reduce the impact of excessively large numbers on the understanding of this design idea, random values are selected within the original value range, such as 5000, 8000, etc. Figure 5 The figure shows the linear linked list of specific characters corresponding to each word class. Taking nouns as an example, there are 5,000 characters that can be used as nouns, including "male", "female", "common people", etc. "Noun" is the first-dimensional linear linked list in the 17-dimensional part-of-speech linear linked list, and its length can reach 5001; "Pronoun" is the second-dimensional linear linked list, and its length is 3000.
[0067] There are approximately 6,500 languages and writing systems globally. For a better understanding of the storage concept in this embodiment, 10 languages are taken as examples for illustration. Based on Chinese characters, the same Chinese character has different representations in different languages. Therefore, the remainder of dividing the position number of the first letter of the Chinese pinyin corresponding to the 10 languages in the 26 letters by 26 is used as the index value for storage, as shown in Table 5.
[0068] Table 5 Linear lists corresponding to different languages
[0069]
[0070] If the language is used as the basis and each character is stored as a storage unit in a linear linked list, it is not logically rigorous enough and the retrieval and query efficiency for locating a specific character is relatively low. In contrast, the language category storage method designed in this embodiment is based on more than 110,000 words and phrases, forming an 110,000-dimensional linear linked list ( Figure 6 ), and each word or phrase represented in 10 languages is used as a storage unit. This method can not only locate a specific word or phrase more quickly but also find the language expression of the corresponding word or phrase according to the order of the index values of each language.
[0071] Among them, the order of the index values of each language is the order after taking the remainder of the position numbers of the first letters of the pinyin of different languages in the alphabet. That is, the Arabic index value is 1 and it is the most forward, followed by German, then Russian, and so on in sequence, which is the "order of the index values of each language" mentioned above.
[0072] Next, the overall process of character storage and the overall process of character retrieval of the present invention are further understood through specific examples.
[0073] (1) Suppose various cross-language expressions of the verb "prosper" are to be stored. First, according to the part of speech "verb", it is determined that "prosper" is a "predicate" in the sentence structure. Then, according to the key index "predicate", the specific class of the grammatical structure of "prosper", namely "transitive predicate", is found. Secondly, according to the "transitive predicate", it is determined that "prosper" belongs to the "development verb" among the "transitive predicates". Furthermore, according to the "development verb", the linear linked list for storing verbs is found, and "prosper" is stored in the linear linked list by obtaining the verb index interval, thus completing the storage operation.
[0074] (2) Assume that the pronoun "you all" is to be searched. First, the pronoun part of speech is used to determine whether "you all" is an "object" or a "subject" in the sentence structure. Then, the key indexes "object" and "subject" are used to search for the specific categories of "direct object" and "pronoun" in the grammatical structure of "you all" respectively. Next, the pronoun in the "direct object" is determined based on the "direct object". Finally, the linear linked list storing the pronouns is found based on the "pronoun". The position of "you all" in the linear linked list is retrieved by obtaining the verb pronoun index interval and the position information is output to complete the search operation.
[0075] In another embodiment, a system for efficiently storing and retrieving text data across languages is also disclosed, and the method for efficiently storing and retrieving text data across languages as described in any one of the above items is applied, including:
[0076] The division module is used to divide different sentences according to the structure of the sentences and construct a structure tree;
[0077] The first building module is used to classify different parts of speech characters according to the grammatical structure to which the characters belong, and form a grammatical linear linked list;
[0078] The second construction module is used to store the same part-of-speech characters in a same-dimensional linear linked list, and form a multi-dimensional part-of-speech linear linked list with part-of-speech categories as dimensions by analogy with the part-of-speech categories;
[0079] The third construction module is used to establish an N-dimensional linear linked list based on Chinese as the retrieval basis, and put different language representations of the same character into the same-dimensional language linear linked list;
[0080] The retrieval module is used to obtain the position of the text to be retrieved and output the position information according to the established grammar linear chain list, part of speech linear chain list and language linear chain list to complete the retrieval operation.
[0081] In another embodiment, a computer storable medium is disclosed, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods for efficiently storing and retrieving cross-language text data are implemented.
[0082] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0083] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for efficiently storing and retrieving text data across languages, characterized in that: The following steps are involved: Divide different sentences according to their structure and construct a structure tree; Classify different parts of speech characters according to the grammatical structure to form a grammatical linear list; The same part-of-speech characters are stored in the same-dimensional linear linked list, and the part-of-speech is inferred in turn to form a multi-dimensional part-of-speech linear linked list with the part-of-speech category as the dimension; An N-dimensional linear linked list is established based on Chinese as the retrieval basis, and different language representations of the same character are placed in the same-dimensional language linear linked list; Based on the established grammar linear linked list, part of speech linear linked list and language linear linked list, the position of the text to be searched is obtained and the position information is output to complete the search operation.
2. A method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: The classification categories include: subject-predicate, subject-predicate-object, subject-predicate-double-object, subject-predicate-object complement, and subject-copula-predicate.
3. A method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: In the structure tree, the root node is the subject, and the child nodes of the subject are the transitive predicate, intransitive predicate, and copula; the child node of the transitive predicate is the direct object, and the child nodes of the direct object are the indirect object and object complement; the child node of the copula is the predicate; and the intransitive predicate has no child nodes.
4. The method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: In the structure tree, each node stores the index value of the head node in the linear linked list of all parts of speech that can be used for the node.
5. The method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: In the linear list of parts of speech, the part-of-speech sequences linked after the index values of different dimensions are fixed to distinguish the categories when the index values are the same.
6. The method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: When forming a grammatical linear linked list, the first letter of the corresponding English word is obtained through the Chinese-English comparison table of the part-of-speech category, the position number of the first letter in the alphabet is determined, and the remainder of 26 is taken as the index value to store the part-of-speech category.
7. The method for efficiently storing and retrieving cross-language text data according to claim 1, characterized in that: In the linear linked list of languages, the language expression of the corresponding text is found according to the order of the index values of each language; wherein the order of the index values of each language is the order after the position numbers of the first letters of the pinyin of different languages in the alphabet are taken as remainders of 26.
8. A system for efficiently storing and retrieving text data across languages, using the method for efficiently storing and retrieving text data across languages as claimed in any one of claims 1 to 7, characterized in that: include: The division module is used to divide different sentences according to the structure of the sentences and construct a structure tree; The first building module is used to classify different parts of speech characters according to the grammatical structure to which the characters belong, and form a grammatical linear linked list; The second construction module is used to store the same part-of-speech characters in a same-dimensional linear linked list, and form a multi-dimensional part-of-speech linear linked list with part-of-speech categories as dimensions by analogy with the part-of-speech categories; The third construction module is used to establish an N-dimensional linear linked list based on Chinese as the retrieval basis, and put different language representations of the same character into the same-dimensional language linear linked list; The retrieval module is used to obtain the position of the text to be retrieved and output the position information according to the established grammar linear chain list, part of speech linear chain list and language linear chain list to complete the retrieval operation.
9. A computer storable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for efficiently storing and retrieving text data across languages as claimed in any one of claims 1 to 7 are implemented.