CN111597324B - Text query method and device - Google Patents
Text query method and device Download PDFInfo
- Publication number
- CN111597324B CN111597324B CN202010430240.0A CN202010430240A CN111597324B CN 111597324 B CN111597324 B CN 111597324B CN 202010430240 A CN202010430240 A CN 202010430240A CN 111597324 B CN111597324 B CN 111597324B
- Authority
- CN
- China
- Prior art keywords
- text
- poetry
- target
- poem
- entry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/338—Presentation of query results
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
The embodiment of the application discloses a text query method and a text query device, wherein the method comprises the following steps: firstly, acquiring a text to be recognized by responding to the scanning operation of a dictionary pen on the text to be recognized; matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified; and finally, displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen. The poetry range covered by the preset poetry entry is larger, the text to be identified can be flexibly inquired in the larger poetry range, and the method is not limited by the learning resources of fixed poetry. Moreover, the text to be identified is matched with the preset poetry entry, so that the target poetry entry and the interpretation text of the target poetry entry can be obtained rapidly, a user can obtain a scanning and inquiring result in time, and comprehensive relevant information of the text to be identified is obtained.
Description
Technical Field
The application relates to the technical field of data processing, in particular to a text query method and a text query device.
Background
In actual life, the user can learn the ancient poetry by means of some terminal devices. At present, most of devices used for ancient poetry learning are conventional code spreading type touch and talk pens. The user firstly needs to set a poetry reading package resource in the reading pen, and then realizes reading learning of the paleopoetry text in the matched books by reading books matched with the reading package resource.
However, in the prior art, the click-to-read package resource and the matched book resource have limitations, resulting in limited poetry resources that can be learned in this way. And only the click reading of the poetry text can be realized, and other relevant information of the poetry cannot be further and rapidly inquired.
Disclosure of Invention
In view of this, the embodiments of the present application provide a text query method and apparatus, so as to implement quick query for related content of text related to poetry.
In order to solve the above problems, the technical solution provided by the embodiment of the present application is as follows:
a text query method, the method being applied to a dictionary pen, the method comprising:
responding to the scanning operation of the text to be recognized by using the dictionary pen, and acquiring the text to be recognized;
matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified;
Acquiring an explanation text of the target poetry entry;
and displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
In one possible implementation manner, the matching the text to be identified with a preset poem term, and determining a target poem term matched with the text to be identified includes:
performing clause processing on the text to be recognized according to characters and punctuation marks included in the text to be recognized to obtain the clause number of the text to be recognized;
matching the text to be recognized with first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries corresponding to the number of the clauses of the text to be recognized;
determining a first poem term with a first matching result meeting a first preset condition as a target poem term matched with the text to be identified;
when the first matching result of each first poem term does not accord with the first preset condition, determining a target poem term matched with the text to be identified by utilizing the clause included in the text to be identified.
In one possible implementation manner, when the first matching result does not meet a first preset condition, determining, by using the clause included in the text to be recognized, a target poetry entry matched with the text to be recognized includes:
Removing target clauses from the text to be recognized to generate partial text to be recognized, wherein the target clauses are respectively a first clause in the text to be recognized, a last clause in the text to be recognized, and the first clause and the last clause in the text to be recognized;
matching the part of the text to be recognized with second poetry entries to obtain second matching results of the second poetry entries, wherein the second poetry entries are poetry entries corresponding to the number of clauses of the part of the text to be recognized;
and determining a second poem term with a second matching result meeting a second preset condition as a target poem term matched with the text to be identified.
In one possible implementation, the poetry term includes a poetry term, a poetry title term, and a poetry author term.
In one possible implementation, the method further includes:
dividing the target poetry entry into at least one text unit, wherein each text unit comprises idioms, words or Chinese characters;
responding to the triggering operation of the target poetry entry, and determining a text unit corresponding to the triggering operation;
acquiring an interpretation text of a text unit corresponding to the triggering operation;
And displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on a display screen of the dictionary pen.
In a possible implementation manner, the splitting the target poetry term into at least one text unit includes:
if the target poetry entry comprises idioms, segmenting the idioms comprising the target poetry entry into text units;
if the part of the target poetry term except the idiom comprises a word, dividing the word included in the target poetry term into text units;
and dividing each Chinese character except idioms and words in the target poetry entry into text units.
In one possible implementation, the method further includes:
when the target poetry term is a poetry term, acquiring the full text of the poetry corresponding to the target poetry term and the explanation text of the full text of the poetry;
and displaying the full text of the poem corresponding to the target poem and the explanation text of the full text of the poem on a display screen of the dictionary pen.
A text query device, the device being applied to a dictionary pen, the device comprising:
the text to be recognized acquiring unit is used for responding to the scanning operation of the text to be recognized by using the dictionary pen and acquiring the text to be recognized;
The target poem term determining unit is used for matching the text to be identified with preset poem terms and determining target poem terms matched with the text to be identified;
an interpretation text obtaining unit, configured to obtain an interpretation text of the target poetry term;
and the display unit is used for displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
In one possible implementation manner, the target poetry determining unit includes:
the clause number determining subunit is used for carrying out clause processing on the text to be identified according to the characters and punctuation marks included in the text to be identified to obtain the clause number of the text to be identified;
the matching subunit is used for matching the text to be identified with first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries corresponding to the number of the clauses of the text to be identified;
the first determining subunit is used for determining the first poem entry, the first matching result of which meets the first preset condition, as the target poem entry matched with the text to be identified;
And the second determining subunit is used for determining the target poem entry matched with the text to be identified by using the clause included in the text to be identified when the first matching result of each first poem entry does not meet the first preset condition.
In one possible implementation, the second determining subunit includes:
a partial text to be identified generating subunit, configured to remove a target clause from the text to be identified, and generate a partial text to be identified, where the target clause is a first clause in the text to be identified, a last clause in the text to be identified, and a first clause and a last clause in the text to be identified, respectively;
the poetry term matching subunit is used for matching the part of the text to be identified with second poetry terms to obtain second matching results of the second poetry terms, wherein the second poetry terms are poetry terms corresponding to the number of the clauses of the part of the text to be identified;
and the third determining subunit is used for determining the second poem entry, the second matching result of which meets the second preset condition, as the target poem entry matched with the text to be identified.
In one possible implementation, the poetry term includes a poetry term, a poetry title term, and a poetry author term.
In one possible implementation, the apparatus further includes:
a text unit segmentation unit, configured to segment the target poetry term into at least one text unit, where each text unit includes idioms, words, or Chinese characters;
the text unit determining unit is used for responding to the triggering operation of the target poetry entry and determining a text unit corresponding to the triggering operation;
a text unit interpretation text obtaining unit, configured to obtain an interpretation text of the text unit corresponding to the triggering operation;
and the text unit display unit is used for displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on the display screen of the dictionary pen.
In one possible implementation manner, the text unit segmentation unit includes:
a idiom segmentation subunit, configured to segment, if the target poetry term includes an idiom, an idiom included in the target poetry term into a text unit;
the word segmentation subunit is used for segmenting the words included in the target poetry entry into text units if the part except the idioms in the target poetry entry includes the words;
And the Chinese character segmentation subunit is used for segmenting each Chinese character except idioms and words in the target poem entry into text units.
In one possible implementation, the apparatus further includes:
the poetry full text obtaining unit is used for obtaining the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text when the target poetry entry is the poetry entry;
and the poetry full text display unit is used for displaying the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text on the display screen of the dictionary pen.
A dictionary pen for text queries, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for:
responding to the scanning operation of the text to be recognized by using the dictionary pen, and acquiring the text to be recognized;
matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified;
Acquiring an explanation text of the target poetry entry;
and displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
A computer-readable medium having instructions stored thereon that, when executed by one or more processors, cause an apparatus to perform the text query method.
From this, the embodiment of the application has the following beneficial effects:
in the embodiment of the application, the text to be recognized is firstly obtained by responding to the scanning operation of the dictionary pen on the text to be recognized; matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified; and acquiring the interpretation text of the target poem entry, and displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen. The poetry range covered by the preset poetry entry is larger, the text to be identified can be flexibly inquired in the larger poetry range by scanning any text, and the method is not limited by fixed poetry learning resources. Moreover, the text to be identified is matched with the preset poetry entry, so that the target poetry entry and the interpretation text of the target poetry entry can be obtained rapidly, a user can obtain a scanning and inquiring result in time, and comprehensive relevant information of the text to be identified is obtained.
Drawings
Fig. 1 is a schematic diagram of an exemplary application scenario of a text query method according to an embodiment of the present application;
FIG. 2 is a flowchart of a text query method applied to a dictionary pen according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for determining target poetry entries according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a text query device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a client according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of embodiments of the application will be rendered by reference to the appended drawings and appended drawings.
In order to facilitate understanding and explanation of the technical solutions provided by the embodiments of the present application, the following description will first explain the background art of the present application.
After researching the traditional text query method, the inventor finds that the existing text query for poems is limited to the range of poem resources built in the touch-and-talk pen. The user can read the poetry text in the matched resources through the reading pen, and the voice corresponding to the poetry text can be obtained from the matched poetry resources built in the reading pen. Because the existing text query for poems needs books matched with a touch-and-talk pen and is limited by built-in resources in the touch-and-talk pen, the query for any poems is difficult to realize, and the types of query results obtained according to the matched built-in resources are limited, so that the related information of the poems which are queried comprehensively cannot be obtained.
Based on the above, the embodiment of the application provides a text query method, which comprises the following steps: responding to the scanning operation of the text to be recognized by using a dictionary pen, and firstly acquiring the text to be recognized; matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified; acquiring an interpretation text of the target poetry entry; and finally, displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen. Therefore, the text to be recognized can be scanned according to the query or learning requirement, so that the query result of the text to be recognized is obtained, and the method is not limited by the learning resources of fixed poems. Through scanning the text to be recognized and matching the text to be recognized with the preset poetry entry, the relevant information of the poetry can be obtained rapidly, a user can obtain the result of scanning and inquiring in time, and comprehensive poetry learning is performed.
In order to facilitate understanding of the text query method provided by the embodiment of the present application, an application scenario of the text query method provided by the embodiment of the present application is described with reference to fig. 1. Fig. 1 is a schematic diagram of an exemplary application scenario of a text query method according to an embodiment of the present application. The text query method provided by the embodiment of the application can be applied to the dictionary pen 101.
In practical application, the dictionary pen 101 obtains the text to be recognized in response to a scanning operation of the user to the text to be recognized by using the dictionary pen 101. Then, the dictionary pen 101 matches the text to be recognized with the preset poem term, determines the target poem term matched with the text to be recognized, obtains the interpretation text of the target poem term, and displays the target poem term and the interpretation text of the target poem term on the display screen.
Those skilled in the art will appreciate that the frame diagram shown in fig. 1 is but one example in which embodiments of the present application may be implemented. The scope of applicability of the embodiments of the application is not limited in any way by the framework.
It should be noted that, according to the dictionary pen 101 in the embodiment of the present application, the target poem entry matching with the text to be recognized may be determined according to the built-in poem entry database, and the interpretation text of the target poem entry may be obtained. The dictionary pen 101 may also perform information interaction with a server, so as to determine a target poem entry matched with the text to be recognized through the server, and obtain an interpretation text of the target poem entry.
It should be noted that the dictionary pen 101 may be an existing, developing or future developed dictionary pen capable of interacting with one another via any form of wired and/or wireless connection (e.g., wi-Fi, LAN, cellular, coaxial cable, etc.). Embodiments of the application are not limited in this respect. It is also noted that the server in embodiments of the present application may be one example of an existing, developing or future developed device capable of providing text queries to the dictionary pen 101. Embodiments of the application are not limited in this respect.
In order to facilitate understanding of the technical solution provided by the embodiments of the present application, a text query method provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, a flowchart of a text query method applied to a dictionary pen according to an embodiment of the present application is shown. As shown in fig. 2, the method may include steps S201-S204:
s201: and acquiring the text to be recognized in response to the scanning operation of the text to be recognized by using the dictionary pen.
When a user encounters poems needing to be queried in the reading or browsing process, the dictionary pen can be utilized to scan the text to be identified. And the dictionary pen responds to the scanning operation of the text to be recognized by using the dictionary pen, and the text to be recognized scanned by the user is obtained. For example, when a user reads, the poem of "the young bird flies to february, the dike is flicked, the young bird drinks the spring cigarette" is not understood, the text of "feiyangling feiyun" can be scanned with the dictionary pen scanning operation to query with the dictionary pen.
The text to be identified is the text which is required to be queried and is obtained by the user through scanning, the source of the text to be identified is not limited, any text to be queried can be obtained through scanning operation, the text query is not limited to preset poetry learning resources any more, and only poetry in the matched poetry learning resources which are configured in advance can be queried.
The method for acquiring the text to be recognized by the dictionary pen through scanning operation is not limited in the embodiment of the application, and in a possible implementation manner, the text to be recognized can be scanned and acquired through an optical character recognition technology and a frame splicing technology.
S202: and matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified.
After the text to be recognized is obtained, the text to be recognized is matched with a preset poem entry. It should be noted that the poem term may be one or more of a poem term, a poem title term and a poem author term. The poetry entry is an entry consisting of a poetry, the poetry title entry is an entry consisting of a title of the poetry, and the poetry author entry is an entry consisting of an author name or an alias and a name of the author.
The preset poetry entry is used for matching with the text to be identified and determining poetry corresponding to the text to be identified. In the embodiment of the application, in order to expand the query range of a user for poems, the preset poems can be established according to a classical poem dictionary or a database related to poems, and a larger number and a larger range of poems can be covered.
It should be noted that, in order to improve accuracy of text query for poems and facilitate a user to obtain a corresponding query result by scanning any number of poems, the poems in the poems may be obtained by sequentially combining any number of clauses in the poems. The clause may be a sentence divided in punctuation. For example, for "young grass fly feiyue, the dike is flicked and the young willow is flicked. The children's study returns to early, and the paper iris is put when the children are busy. The poetry can obtain target poetry entries matched with the text to be recognized by scanning any single, double, triple or full poetry by a user conveniently. Four single sentences, "the young fly in february, the dike and the young willow drunk spring cigarettes" and the dike and the young willow drunk spring cigarettes "can be included in the preset poem entry aiming at the poem. The three double sentences of "the child powder study returns to the beginning" the paper iris is put in the busy state while the child is in the east wind "the grass is in february day, the dike is brushed, and the willow is drunk as spring cigarette. The children learn to come early in a scattered way and the young and young leaves of the dike are brushed with each other to drunk spring cigarettes. The children learn about the Chinese medicine powder in the morning, put two or three sentences of the iris while the children are busy, and four sentences of the whole poem.
Through matching the text to be identified with preset poetry entries, target poetry entries with higher matching degree with the text to be identified can be determined in the preset poetry entries, and further the interpretation text is acquired and displayed through the target poetry entries.
Specifically, the target poetry entry matched with the text to be recognized can be determined by presetting conditions to be met by matching, and the embodiment of the application provides a specific implementation manner of S202, please refer to the following.
In the embodiment of the application, the text to be recognized is matched with the preset poem entry containing a larger poem range, so that the target poem entry matched with the text to be recognized can be determined. Therefore, the target poem entry matched with the text to be identified can be determined in the poem entries containing a large poem range, the query of the text to be identified is further realized, and the limitation of poem query in limited resources is avoided.
S203: and acquiring the interpretation text of the target poetry entry.
The interpretation text is text corresponding to the target poetry term and having interpretation information of poetry corresponding to the target poetry term. The explanation text may include an explanation of a poem corresponding to the target poem term, an explanation of a poem title corresponding to the target poem term, and basic information of a poem corresponding to the target poem term, such as an author profile of a poem corresponding to the target poem term.
It may be appreciated that, if the target poem term is one or more of a poem term, a poem title term, and a poem author term, the type of content in the interpreted text may correspond to the type of the target poem term. For example, if the target poem term is a poem term, the interpretation text of the target poem term may have a translation of a poem corresponding to the poem term, a title of the poem to which the poem belongs, and an author of the poem. If the target poem term is a poem author term, the interpretation text of the target poem term may be a brief introduction of the poem author.
The method for acquiring the interpretation text of the target poetry entry is not limited in the embodiment of the application. In one possible implementation manner, the preset target poetry term has a preset corresponding interpretation text, and after the target poetry term is determined, the interpretation text corresponding to the target poetry term can be directly obtained. In another possible implementation manner, after determining the target poem term, if the target poem term is a poem term, translation technology may be utilized to translate the poem in the target poem term to obtain a translation text of the poem corresponding to the target poem term; and determining the poetry titles and authors corresponding to the target poetry entries by inquiring the poetry to which the poetry belongs, and taking the translated text and the poetry titles and authors as explanatory text. If the target poetry entry is a poetry author entry, matching the author profile according to the author name in the target poetry entry, and taking the matched author profile as an explanation text.
Because the target poetry is the poetry matched with the text to be recognized, the obtained interpretation text of the target poetry is the corresponding interpretation text of the text to be recognized. And acquiring the interpretation information about the text to be recognized through the interpretation text of the target poetry entry.
S204: and displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
Displaying the determined target poetry entries and the acquired interpretation text of the target poetry entries on a display screen, and obtaining the poetry entries and related interpretation text with higher matching degree with the text to be identified by a user through the target poetry entries and the interpretation text of the target poetry entries displayed on the display screen.
Since when the user makes a query for a poem, it may be desirable to obtain a full poem corresponding to the poem and an explanation of the full poem from the query result. Therefore, when the target poem entry matched with the text to be recognized is a poem entry, the full text of the poem and the interpretation text of the full poem can be obtained.
The text query method provided by the embodiment of the application further comprises the following steps:
when the target poem term is a poem term, acquiring the full text of the poem corresponding to the target poem term and the explanation text of the full text of the poem;
And displaying the full text of the poem corresponding to the target poem entry and the interpretation text of the full text of the poem on the display screen of the dictionary pen.
When the target poetry entry is a poetry entry, besides the interpretation text of the target poetry entry, the poetry full text corresponding to the target poetry entry can be acquired. The embodiment of the application does not limit the method for acquiring the full text of the poems corresponding to the target poems, and the method can be obtained by carrying out full text matching on the poems in the target poems. In addition, in order to facilitate the user to understand the full text of the poetry, the explanation text of the full text of the poetry can be obtained according to the acquired full text of the poetry corresponding to the target poetry.
And displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen, and displaying the full text of the poem corresponding to the target poem entry and the interpretation text of the full text of the poem. So that a user can acquire the poetry full text and the interpretation text corresponding to the target poetry entry in addition to acquiring the target poetry entry matched with the text to be recognized and the interpretation text of the target poetry entry, and learn the poetry full text.
Based on the content of S201-S204, it can be known that, by matching the text to be identified with the preset poetry entry to determine the target poetry entry, the target poetry entry matched with the text to be identified can be determined in a larger poetry range, and the range of poetry query is enlarged. Through acquiring the explanation text of the target poetry entry and displaying the target poetry entry and the explanation text on the display screen, a user can quickly acquire the target poetry entry and the explanation text corresponding to the text to be recognized, and can acquire the related information of the text to be recognized, so that the user can understand and learn the poetry conveniently.
In the embodiment of the application, the number of the poetry entries obtained according to the larger poetry range is larger, and if the text to be recognized is matched with the preset poetry entries one by one, the matching speed is slower. In addition, because the range of poems covered by the preset poems is larger, similar or similar poems may exist, and the matching degree of the target poems and the text to be identified needs to be improved.
Based on the foregoing, in one possible implementation manner of the embodiment of the present application, a implementation manner of S202 is further provided. Referring to fig. 3, a flowchart of a method for determining a target poetry entry according to an embodiment of the present application is shown. As shown in fig. 3, the method may include steps S301-S304:
s301: and carrying out clause processing on the text to be recognized according to the characters and punctuation marks included in the text to be recognized, and obtaining the clause number of the text to be recognized.
It can be understood that the poetry entry is composed of different numbers of clauses, and before the text to be recognized is matched with the poetry entry, the clause processing can be performed on the text to be recognized, so as to obtain the number of the clauses of the text to be recognized. According to the number of the clauses of the text to be recognized, the matching of the text to be recognized and the poetry entries is carried out, so that the number of the poetry entries to be matched can be reduced, and the matching speed of the text to be recognized and the poetry entries can be increased.
In the embodiment of the application, the text to be recognized can be divided into clauses according to the characters and punctuation marks in the text to be recognized. Specifically, punctuation marks in the text to be recognized can be utilized to divide characters, and the divided continuous characters are used as a clause. For example, if the text to be recognized is "turn Zhu Ge, the user is low and sleeps. What should have been the same as the other circle? If the text to be recognized has twenty characters and five punctuations, the text to be recognized can be correspondingly divided into five clauses according to the position relation between each character and each punctuation, the numbers of the clauses of the text to be identified are five, which are respectively 'turning Zhu Ge', 'low-qi user', 'no sleep', 'no need to have an abruptness', 'how long to be round at other time'.
It should be noted that, in some cases, the text to be recognized does not have punctuation marks, for example, when the text to be recognized is a sentence without punctuation marks in poetry, a poetry title, or an author, the number of sentences of the text to be recognized may be determined as one.
S302: and matching the text to be recognized with the first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries corresponding to the number of the clauses of the text to be recognized.
And in the preset poetry entries, determining a first poetry entry according to the number of the clauses of the text to be recognized. The first poem entry is a poem entry with the number of clauses corresponding to the number of clauses of the text to be recognized. The number of clauses of the first poetry entry may be the same as the number of clauses of the text to be recognized.
And matching the text to be identified with the first poetry entry to obtain a first matching result. The first matching result is a matching result of the first poetry term and the text to be identified, and can represent the matching degree of the first poetry term and the text to be identified. The first matching result may be determined according to the order of characters in the text to be recognized and the first poetry term and the same degree. In one possible implementation, the first matching result may be determined according to the same order of character duty ratio of the text to be recognized in the first poetry.
It should be noted that, in the embodiment of the present application, the method for matching the text to be recognized with the first poetry entry is not limited. In a possible implementation manner, the text to be recognized may be matched with all the first poetry entries, first matching results corresponding to all the first poetry entries are obtained, and then S303 is executed to determine the target poetry entries; in another possible implementation manner, the text to be recognized is matched with the first poetry term, S303 is executed after the first matching result is obtained, and if the target poetry term is determined, the matching of the text to be recognized and other first poetry terms is not performed.
S303: and determining the first poem entry, the first matching result of which meets the first preset condition, as a target poem entry matched with the text to be identified.
It is understood that the first matching result may represent a degree of matching of the first poetry term with the text to be recognized. In order to obtain the first poetry entry with higher matching degree, a first preset condition can be set, and the first poetry entry with the first matching result meeting the first preset condition is used as the target poetry entry.
The text to be identified may have different numbers of clauses, and for the text to be identified with a smaller number of clauses, such as a single sentence, a title or an author of a poem, the text to be identified contains less information, and the determined target poem entry needs a higher matching degree; for the text to be recognized with more clauses, the text to be recognized contains more information, and the required matching degree of the determined target poetry entry can be slightly lower. Specifically, when the text to be identified is a single sentence, the first preset condition may be that the first matching result is a complete match; when the text to be recognized is a plurality of sentences, the first preset condition can be that the first matching result is larger than a first matching threshold value. The first matching threshold may be set according to actual needs, and the value of the matching degree is higher, for example, the first matching threshold may be 90%.
S304: when the first matching result of each first poem term does not accord with the first preset condition, determining a target poem term matched with the text to be identified by utilizing the clause included in the text to be identified.
In some possible cases, the text to be recognized obtained by the user's scan may not be a complete verse, e.g., the user is scanning "Zhu Ge, low-power, and sleepless. What should have been the same as the other circle? When the character is deleted, the text to be recognized acquired by the dictionary pen can be pavilion, low-quality users and sleepless. There should be no abruptness and long things. Or when the user scans, partial characters of the front and rear verses are scanned, and inaccurate verses are obtained. For example, the text to be recognized is "should there be no abruptness, what is going to the circle of other hours? It is described that. After the first poetry entries are matched, because the front and rear clauses have the condition of missing characters or adding irrelevant characters, the first matching result of each first poetry entry can not meet the first preset condition, and the target poetry entry can not be determined.
When the first matching result of the text to be recognized and each first poetry term cannot meet the first preset condition, the obtained text to be recognized is possibly inaccurate or incomplete. When the number of the clauses in the text to be identified is large, the clauses in the text to be identified may accurately represent poems required to be queried by the user, and the target poems can be further determined by using the clauses in the text to be identified.
In the embodiment of the application, the first poetry entry to be matched with the text to be identified is determined by determining the number of the clauses of the text to be identified. Therefore, the range of the poetry entry to be matched can be reduced, and the matching speed of the text to be identified and the poetry entry is increased. In addition, through setting up first preset condition, get rid of the first poetry entry that first matching result does not accord with first preset condition, regard first poetry entry that first matching result accords with first preset condition as target poetry entry. Through setting up first default, can regard as target poetry entry with the higher first poetry entry of matching degree for the target poetry entry that obtains matches more with the poetry that interpretation text and user need inquire, the degree of accuracy is higher.
Based on the above-mentioned content in S304, when the first matching result of each first poem term cannot meet the first preset condition, the determining of the target poem term may be performed according to the clause in the text to be recognized, which may specifically include the following three steps:
a1: and removing a target clause from the text to be recognized to generate a part of text to be recognized, wherein the target clause is respectively the first clause in the text to be recognized, the last clause in the text to be recognized, and the first clause and the last clause in the text to be recognized.
When a user scans a text to be recognized, the text to be recognized may be obtained by unsuccessfully scanning or incorrectly scanning part of characters or punctuations due to the uncertain scanning range when the user starts scanning or ends scanning. Matching with the first poem term is performed according to the text to be recognized, which has a problem, and the target poem term may not be determined.
At this time, the text to be recognized can be processed, and the clauses which may have incomplete text or are inaccurate are removed, so that complete and accurate clauses are obtained, and the processed clauses are utilized to determine the target poem entry. In view of the fact that the clause possibly having text loss or increased text errors may be the first clause and/or the last clause, the first clause, the last clause, the first clause and the last clause can be respectively used as target clauses, the target clause is removed from the text to be recognized, partial text to be recognized is obtained, and matching with poem entry is performed by utilizing the partial text to be recognized.
The text to be identified is still taken as a pavilion, so that the user is low in quality and sleepless. The method includes that a user does not have a certain content, and the user takes a certain content as an example, and uses a certain content as a target clause to remove the certain content, so that the user does not sleep. There should be no remoistening, long, pavilion, low-level households, and no sleep. There should be no "and" low-qi households, "and no sleep. There should be no sores. And matching the subsequent poetry entries by using the three parts of texts to be identified.
A2: and matching the part of the text to be recognized with the second poetry entries to obtain second matching results of the second poetry entries, wherein the second poetry entries are poetry entries corresponding to the number of the clauses of the part of the text to be recognized.
Since the number of the clauses of the part of the text to be recognized is changed compared with the text to be recognized, the number of the clauses of the part of the text to be recognized can be determined, and the second poem entry to be matched is determined according to the number of the clauses of the part of the text to be recognized. The second poetry entries are poetry entries corresponding to the number of the text clauses to be recognized, and the number of the clauses in the second poetry entries can be the same as the text to be recognized.
And matching part of the text to be recognized with the second poetry entry to obtain a second matching result of the second poetry entry. The second matching result may be used to represent a matching degree of a part of the text to be recognized and the second poetry term. The second matching result may be determined according to the character ratios of the same order of the part of the text to be recognized in the second poetry term.
For example, based on the above example, part of the text to be recognized is "low-qi user, and the user is not asleep. There should be no remoistening, long, pavilion, low-level households, and no sleep. There should be no moderation, "and" low-qi households, no sleep. There should be no sores. And (5) for part of texts to be identified, the texts are 'low-quality households', and the user is not asleep. The method includes that the phenomenon that the text to be recognized is not found, the number of the clauses of the part of the text to be recognized is 4, the poetry entry with the number of the clauses of 4 in the poetry entry is used as a second poetry entry, and the second poetry entry is matched with the part of the text to be recognized, so that a second matching result of the second poetry entry is obtained. The matching methods of the other two parts of text to be recognized are similar, and are not described in detail herein.
A3: and determining the second poem entry, the second matching result of which meets the second preset condition, as a target poem entry matched with the text to be identified.
It should be noted that, the second preset condition may be set according to the number of clauses of the part of the text to be recognized. When the clause of the part of the text to be recognized is a single sentence, the second preset condition can be that the second matching result is complete matching; when part of the text to be recognized is a plurality of sentences, the second preset condition can be that the second matching result is larger than a second matching threshold value. The setting method of the second preset condition may be similar to the setting method of the first preset condition in S303, and will not be described herein.
And determining a second poem entry, the second matching result of which meets a second preset condition, as a target poem entry matched with the text to be identified.
And taking the text to be identified as a pavilion, so that the user is low in quality and sleepless. The method includes the steps that when a part of texts to be recognized are generated, the part of texts to be recognized are matched with second poetry entries, and the obtained second matching result meets a second matching threshold, and the poetry entries are 'low-level households' and fall asleep. There should not be any wall, and the poem entry is used as the target poem entry matched with the text to be identified.
Further, since the number of the to-be-recognized texts corresponding to the same to-be-recognized text is three, and each to-be-recognized text may determine the corresponding target poem term, in order to provide the relevant information of the to-be-recognized text with a larger range for the user, when the to-be-recognized texts in multiple parts have the matched target poem terms, the target poem term obtained by matching the to-be-recognized text with the largest number of clauses may be determined as the target poem term matched with the to-be-recognized text.
The text to be identified is taken as 'turn Zhu Ge', the user is low in quality, and the user is not asleep. The text to be identified in three parts is "low-quality user" and does not sleep. The people should not have any hawks, have any duration, turn Zhu Ge, have low qi, and have no sleep. There should be no moderation, "and" low-qi households, no sleep. There should be no sores. And matching the text to be recognized with the second poetry entry according to part of the text to be recognized, wherein the second poetry entry meeting the second preset condition is 'turn Zhu Ge', so that the user is low in power and sleepless. There should be no moderation, "and" low-qi households, no sleep. There should be no sores. At this time, the target poem entry corresponding to the text to be recognized with the largest number of clauses, namely 'turn Zhu Ge', is low in the level of the user, and is sleepless. There should be no wall, as the target poem entry of the text to be recognized.
In the embodiment of the application, the target poem entry matched with the text to be identified can be obtained by removing the target clause from the text to be identified and matching part of the text to be identified with the second poem entry. Therefore, the problem that the text to be recognized obtained by scanning by the user is inaccurate or incomplete can be solved, and the target poem entry and the interpretation text corresponding to the text to be recognized can be obtained. The fault tolerance of poetry inquiry is improved, and the problem of repeated operation caused by inaccurate scanning of a user is avoided.
When the user queries poems, further, the meaning of each idiom, word or Chinese character in the poems may need to be clarified, and the query is performed on the idiom, word or Chinese character.
Based on this, the embodiment of the application also provides a text query method, which comprises the following steps besides the steps S201-S04:
b1: the target poetry entry is segmented into at least one text unit, each text unit including idioms, words or Chinese characters.
And cutting the target poem entry matched with the determined text to be identified into at least one text unit. The text unit includes idioms, words, and chinese characters.
When the target poetry entry is cut, the target poetry entry can be cut according to the type of the text unit. It can be understood that when a user queries a text unit, the user queries according to the meaning of the text unit, and usually focuses on the meaning of idioms or terms first and focuses on the meaning of a single Chinese character. When dividing the target poetry entry, dividing the idioms first, dividing the words, and finally dividing the Chinese characters. In one possible implementation, the splitting the target poetry term into at least one text unit includes:
if the target poetry entry comprises idioms, segmenting the idioms comprising the target poetry entry into text units;
if the part of the target poetry term except the idiom comprises the word, dividing the word included in the target poetry term into text units;
and dividing each Chinese character except idioms and words in the target poem entry into text units.
After determining the target poetry entry, the idioms in the target poetry entry can be segmented first, and the obtained idioms are used as text units. And carrying out word segmentation on the part except idioms in the target poem entry, and taking the segmented words as text units. Finally, the part except idioms and words in the target poem entry is segmented into the Chinese characters, and the text units corresponding to the Chinese characters are obtained.
For example, when the target poetry term is "the long-grass bird fly in february", the "long-grass bird fly" belonging to idioms may be cut first, the "february" belonging to the term in the remaining "february day" is cut again, and finally the remaining "day" is cut according to the chinese characters. The final text unit comprises: "Fei's warrior", "Feiyue" and "Tian".
For another example, when the target poem term is "children return to the san school early", the idiom is first segmented, and the target poem term does not include the idiom, so that the text unit belonging to the idiom cannot be obtained. And then the word segmentation is carried out, so that children, coming home and scattered study can be obtained. Finally, the Chinese characters are segmented to obtain early stage.
The text unit is segmented according to the priorities of idioms, words and Chinese characters, so that the habit of inquiring by a user can be better met, and the user can conveniently inquire idioms, words and Chinese characters contained in the target poem entry further.
Further, considering that the user may need to continue querying the text unit, the text unit may also be further subjected to segmentation of the text unit with a lower priority. And carrying out word and Chinese character segmentation on the text units belonging to idioms to obtain the text units. And segmenting the text units belonging to the words into Chinese characters to obtain the text units. If the user triggers the text unit belonging to the target poetry entry, responding to the triggering operation, determining the text unit corresponding to the triggering operation, acquiring the corresponding interpretation text, and displaying the text unit corresponding to the triggering operation and the interpretation text.
Taking the target poetry entry as an example of 'Feiyaoning of grassy long-bird Feiyue', after the user triggers 'Feiyaoning of grassy long-bird', the display screen of the dictionary pen will display the explanation text of 'Feiyaoying of grassy long-bird' and 'Feiyaozhi' of grassy long-bird. Further, the grass long warrior is segmented, and four text units belonging to Chinese characters are obtained as words are not contained. If the user triggers the "warrior", the "warrior" and the explanation text corresponding to the "warrior" are further displayed.
B2: and responding to the triggering operation of the target poetry entry, and determining a text unit corresponding to the triggering operation.
When a user inquires a text unit, the target poetry entry can be directly triggered through the display screen of the dictionary pen. And the dictionary pen responds to the triggering operation of the target poetry entry, and determines a text unit corresponding to the triggering operation. The method for determining the text unit corresponding to the triggering operation is not limited in the embodiment of the application. For example, the trigger position of the user may be determined by the sensing device in the display screen, and the text unit corresponding to the display range including the trigger position may be determined as the text unit corresponding to the trigger operation.
B3: and acquiring an interpretation text of the text unit corresponding to the triggering operation.
And after determining the text unit corresponding to the triggering operation, acquiring the interpretation text of the text unit corresponding to the triggering operation. The interpretation text of the text unit may include an interpretation of the text unit and may further include a use illustrative sentence of the text unit. For example, for a text unit belonging to a idiom, the interpretation text of the text unit may include an interpretation of the idiom, and may also include an example sentence using the idiom; for a text unit belonging to a word, the interpretation text of the text unit may include an interpretation of the word, and may also include an example sentence using the word; for a text unit belonging to a kanji, the interpretation text of the text unit may include an interpretation of the kanji, and may also include an example sentence using the kanji. The interpretation text of the text unit may be preset according to the text unit contained in the target poetry entry, or may be obtained by querying after determining the text unit corresponding to the triggering operation.
B4: and displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on a display screen of the dictionary pen.
After the user performs the triggering operation of the text unit, the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation are displayed on a display screen of the dictionary pen, so that the user can acquire the relevant interpretation information of the text unit.
In the embodiment of the application, the text unit can be obtained by cutting the target poetry entry, and the user can trigger the text unit. Correspondingly, the dictionary pen responds to the triggering operation, and displays the text unit and the interpretation text of the text unit, so that the user can conveniently further inquire the text unit in the target poem entry.
Based on the text query method provided by the embodiment of the method, the embodiment of the application also provides a text query device, and the text query device is respectively described below with reference to the accompanying drawings.
Referring to fig. 4, the structure of a text query device according to an embodiment of the present application is shown.
The text query device provided by the embodiment of the application is applied to dictionary pens, and comprises:
a text to be recognized obtaining unit 401, configured to obtain a text to be recognized in response to a scanning operation of the text to be recognized using the dictionary pen;
a target poem term determining unit 402, configured to match the text to be identified with a preset poem term, and determine a target poem term matched with the text to be identified;
an interpretation text obtaining unit 403, configured to obtain interpretation text of the target poetry term;
And the display unit 404 is configured to display the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
Optionally, the target poetry term determining unit 402 includes:
the clause number determining subunit is used for carrying out clause processing on the text to be identified according to the characters and punctuation marks included in the text to be identified to obtain the clause number of the text to be identified;
the matching subunit is used for matching the text to be identified with first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries corresponding to the number of the clauses of the text to be identified;
the first determining subunit is used for determining the first poem entry, the first matching result of which meets the first preset condition, as the target poem entry matched with the text to be identified;
and the second determining subunit is used for determining the target poem entry matched with the text to be identified by using the clause included in the text to be identified when the first matching result of each first poem entry does not meet the first preset condition.
Optionally, the second determining subunit includes:
A partial text to be identified generating subunit, configured to remove a target clause from the text to be identified, and generate a partial text to be identified, where the target clause is a first clause in the text to be identified, a last clause in the text to be identified, and a first clause and a last clause in the text to be identified, respectively;
the poetry term matching subunit is used for matching the part of the text to be identified with second poetry terms to obtain second matching results of the second poetry terms, wherein the second poetry terms are poetry terms corresponding to the number of the clauses of the part of the text to be identified;
and the third determining subunit is used for determining the second poem entry, the second matching result of which meets the second preset condition, as the target poem entry matched with the text to be identified.
Optionally, the poetry term includes a poetry term, a poetry title term, and a poetry author term.
Optionally, the apparatus further includes:
a text unit segmentation unit, configured to segment the target poetry term into at least one text unit, where each text unit includes idioms, words, or Chinese characters;
the text unit determining unit is used for responding to the triggering operation of the target poetry entry and determining a text unit corresponding to the triggering operation;
A text unit interpretation text obtaining unit, configured to obtain an interpretation text of the text unit corresponding to the triggering operation;
and the text unit display unit is used for displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on the display screen of the dictionary pen.
Optionally, the text unit segmentation unit includes:
a idiom segmentation subunit, configured to segment, if the target poetry term includes an idiom, an idiom included in the target poetry term into a text unit;
the word segmentation subunit is used for segmenting the words included in the target poetry entry into text units if the part except the idioms in the target poetry entry includes the words;
and the Chinese character segmentation subunit is used for segmenting each Chinese character except idioms and words in the target poem entry into text units.
Optionally, the apparatus further includes:
the poetry full text obtaining unit is used for obtaining the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text when the target poetry entry is the poetry entry;
and the poetry full text display unit is used for displaying the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text on the display screen of the dictionary pen.
Fig. 5 shows a block diagram of a terminal device 1200 for text queries. For example, the terminal device 1200 may be a dictionary pen.
Referring to fig. 5, a terminal device 1200 may include one or more of the following components: a processing component 1202, a memory 1204, a power component 1206, a multimedia component 1208, an audio component 1210, an input/output (I/O) interface 1212, a sensor component 1214, and a communications component 1216.
The processing component 1202 generally controls overall operation of the terminal device 1200, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing element 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1202 may include one or more modules that facilitate interactions between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
The memory 1204 is configured to store various types of data to support operations at the terminal device 1200. Examples of such data include instructions for any application or method operating on terminal device 1200, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1204 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply assembly 1206 provides power to the various components of the terminal device 1200. Power supply component 1206 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for terminal device 1200.
The multimedia component 1208 includes a screen between the terminal device 1200 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and/or a rear camera. When the terminal device 1200 is in an operation mode, such as a photographing mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1210 is configured to output and/or input audio signals. For example, the audio component 1210 includes a Microphone (MIC) configured to receive external audio signals when the terminal device 1200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 1204 or transmitted via the communications component 1216. In some embodiments, audio assembly 1210 further includes a speaker for outputting audio signals.
The I/O interface provides an interface between the processing component 1202 and a peripheral interface module, which may be a keyboard, click wheel, button, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1214 includes one or more sensors for providing status assessment of various aspects of the terminal device 1200. For example, the sensor assembly 1214 may detect the on/off state of the device 1200, the relative positioning of the components, such as the display and keypad of the terminal device 1200, the sensor assembly 1214 may also detect the change in position of the terminal device 1200 or a component of the terminal device 1200, the presence or absence of user contact with the terminal device 1200, the orientation or acceleration/deceleration of the terminal device 1200, and the change in temperature of the terminal device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communications component 1216 is configured to facilitate communication between the terminal device 1200 and other devices, either wired or wireless. The terminal device 1200 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication part 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communications component 1216 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal device 1200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for performing the following methods:
responding to the scanning operation of the text to be recognized by using the dictionary pen, and acquiring the text to be recognized;
Matching the text to be identified with preset poem entries, and determining target poem entries matched with the text to be identified;
acquiring an explanation text of the target poetry entry;
and displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen.
Optionally, the matching the text to be identified with a preset poem term, and determining a target poem term matched with the text to be identified includes:
performing clause processing on the text to be recognized according to characters and punctuation marks included in the text to be recognized to obtain the clause number of the text to be recognized;
matching the text to be recognized with first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries corresponding to the number of the clauses of the text to be recognized;
determining a first poem term with a first matching result meeting a first preset condition as a target poem term matched with the text to be identified;
when the first matching result of each first poem term does not accord with the first preset condition, determining a target poem term matched with the text to be identified by utilizing the clause included in the text to be identified.
Optionally, when the first matching result does not meet a first preset condition, determining, by using the clause included in the text to be recognized, a target poem term matched with the text to be recognized, including:
removing target clauses from the text to be recognized to generate partial text to be recognized, wherein the target clauses are respectively a first clause in the text to be recognized, a last clause in the text to be recognized, and the first clause and the last clause in the text to be recognized;
matching the part of the text to be recognized with second poetry entries to obtain second matching results of the second poetry entries, wherein the second poetry entries are poetry entries corresponding to the number of clauses of the part of the text to be recognized;
and determining a second poem term with a second matching result meeting a second preset condition as a target poem term matched with the text to be identified.
Optionally, the poetry term includes a poetry term, a poetry title term, and a poetry author term.
Optionally, the method further comprises:
dividing the target poetry entry into at least one text unit, wherein each text unit comprises idioms, words or Chinese characters;
Responding to the triggering operation of the target poetry entry, and determining a text unit corresponding to the triggering operation;
acquiring an interpretation text of a text unit corresponding to the triggering operation;
and displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on a display screen of the dictionary pen.
Optionally, the splitting the target poetry term into at least one text unit includes:
if the target poetry entry comprises idioms, segmenting the idioms comprising the target poetry entry into text units;
if the part of the target poetry term except the idiom comprises a word, dividing the word included in the target poetry term into text units;
and dividing each Chinese character except idioms and words in the target poetry entry into text units.
Optionally, the method further comprises:
when the target poetry term is a poetry term, acquiring the full text of the poetry corresponding to the target poetry term and the explanation text of the full text of the poetry;
and displaying the full text of the poem corresponding to the target poem and the explanation text of the full text of the poem on a display screen of the dictionary pen.
Fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application. The server 1300 may vary considerably in configuration or performance and may include one or more central processing units (centralprocessing units, CPU) 1322 (e.g., one or more processors) and memory 1332, one or more storage media 1330 (e.g., one or more mass storage devices) storing applications 1342 or data 1344. Wherein the memory 1332 and storage medium 1330 may be transitory or persistent. The program stored on the storage medium 1330 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Further, the central processor 1322 may be configured to communicate with the storage medium 1330, and execute a series of instruction operations in the storage medium 1330 on the server 1300.
The server 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input/output interfaces 1356, one or more keyboards 1356, and/or one or more operating systems 1341, such as Windows server (tm), mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
In addition, embodiments of the present application provide a computer readable medium having instructions stored thereon that, when executed by one or more processors, cause an apparatus to perform the text query method described above, the apparatus being applicable to a dictionary pen.
It should be noted that, in the present description, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the system or device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant points refer to the description of the method section.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (19)
1. A method of text query, the method being applied to a dictionary pen, the method comprising:
responding to the scanning operation of the text to be recognized by using the dictionary pen, and acquiring the text to be recognized;
matching the text to be identified with preset poetry entries, and determining target poetry entries matched with the text to be identified, wherein the method specifically comprises the following steps of: performing clause processing on the text to be recognized according to characters and punctuation marks included in the text to be recognized to obtain the clause number of the text to be recognized; determining first poem entries according to the number of the clauses of the text to be identified, wherein the first poem entries are poem entries corresponding to the number of the clauses of the text to be identified; matching the text to be recognized with the first poetry term to obtain a first matching result with the first poetry term; determining a first poem term with a first matching result meeting a first preset condition as a target poem term matched with the text to be identified;
Acquiring an explanation text of the target poetry entry;
displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen;
dividing the target poetry entry into at least one text unit, wherein each text unit comprises idioms, words or Chinese characters;
responding to the triggering operation of the target poetry entry through the display screen of the dictionary pen, and determining a text unit corresponding to the triggering operation;
acquiring an interpretation text of a text unit corresponding to the triggering operation;
and displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on a display screen of the dictionary pen.
2. The method of claim 1, wherein the matching the text to be recognized with a preset poem term, determining a target poem term matched with the text to be recognized, further comprises:
when the first matching result of each first poem term does not accord with the first preset condition, determining a target poem term matched with the text to be identified by utilizing the clause included in the text to be identified.
3. The method of claim 2, wherein the determining, using the clause included in the text to be recognized, a target poem entry that matches the text to be recognized, comprises:
Removing target clauses from the text to be recognized to generate partial text to be recognized, wherein the target clauses are respectively a first clause in the text to be recognized, a last clause in the text to be recognized, and the first clause and the last clause in the text to be recognized;
matching the part of the text to be recognized with second poetry entries to obtain second matching results of the second poetry entries, wherein the second poetry entries are poetry entries corresponding to the number of clauses of the part of the text to be recognized;
and determining a second poem term with a second matching result meeting a second preset condition as a target poem term matched with the text to be identified.
4. A method according to any one of claims 1-3, wherein the poetry entries include poetry entries, poetry title entries and poetry author entries.
5. The method of claim 1, wherein the segmenting the target poetry term into at least one text unit comprises:
if the target poetry entry comprises idioms, segmenting the idioms comprising the target poetry entry into text units;
if the part of the target poetry term except the idiom comprises a word, dividing the word included in the target poetry term into text units;
And dividing each Chinese character except idioms and words in the target poetry entry into text units.
6. The method according to claim 1, wherein the method further comprises:
when the target poetry term is a poetry term, acquiring the full text of the poetry corresponding to the target poetry term and the explanation text of the full text of the poetry;
and displaying the full text of the poem corresponding to the target poem and the explanation text of the full text of the poem on a display screen of the dictionary pen.
7. A text query device, the device being applied to a dictionary pen, the device comprising:
the text to be recognized acquiring unit is used for responding to the scanning operation of the text to be recognized by using the dictionary pen and acquiring the text to be recognized;
the target poem term determining unit is used for matching the text to be identified with preset poem terms and determining target poem terms matched with the text to be identified;
an interpretation text obtaining unit, configured to obtain an interpretation text of the target poetry term;
the display unit is used for displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen;
The target poetry term determining unit includes:
the clause number determining subunit is used for carrying out clause processing on the text to be identified according to the characters and punctuation marks included in the text to be identified to obtain the clause number of the text to be identified;
the matching subunit is used for matching the text to be identified with first poetry entries to obtain a first matching result of the first poetry entries, wherein the first poetry entries are poetry entries which are determined according to the number of clauses of the text to be identified and correspond to the number of clauses of the text to be identified;
the first determining subunit is used for determining the first poem entry, the first matching result of which meets the first preset condition, as the target poem entry matched with the text to be identified;
the apparatus further comprises:
a text unit segmentation unit, configured to segment the target poetry term into at least one text unit, where each text unit includes idioms, words, or Chinese characters;
a text unit determining unit, configured to determine a text unit corresponding to a triggering operation of the target poem entry through a display screen of the dictionary pen;
A text unit interpretation text obtaining unit, configured to obtain an interpretation text of the text unit corresponding to the triggering operation;
and the text unit display unit is used for displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on the display screen of the dictionary pen.
8. The apparatus of claim 7, wherein the target poetry term determining unit further comprises:
and the second determining subunit is used for determining the target poem entry matched with the text to be identified by using the clause included in the text to be identified when the first matching result of each first poem entry does not meet the first preset condition.
9. The apparatus of claim 8, wherein the second determination subunit comprises:
a partial text to be identified generating subunit, configured to remove a target clause from the text to be identified, and generate a partial text to be identified, where the target clause is a first clause in the text to be identified, a last clause in the text to be identified, and a first clause and a last clause in the text to be identified, respectively;
the poetry term matching subunit is used for matching the part of the text to be identified with second poetry terms to obtain second matching results of the second poetry terms, wherein the second poetry terms are poetry terms corresponding to the number of the clauses of the part of the text to be identified;
And the third determining subunit is used for determining the second poem entry, the second matching result of which meets the second preset condition, as the target poem entry matched with the text to be identified.
10. The apparatus of any of claims 7-9, wherein the poetry entries include poetry entries, poetry title entries, and poetry author entries.
11. The apparatus of claim 7, wherein the text unit segmentation unit comprises:
a idiom segmentation subunit, configured to segment, if the target poetry term includes an idiom, an idiom included in the target poetry term into a text unit;
the word segmentation subunit is used for segmenting the words included in the target poetry entry into text units if the part except the idioms in the target poetry entry includes the words;
and the Chinese character segmentation subunit is used for segmenting each Chinese character except idioms and words in the target poem entry into text units.
12. The apparatus of claim 7, wherein the apparatus further comprises:
the poetry full text obtaining unit is used for obtaining the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text when the target poetry entry is the poetry entry;
And the poetry full text display unit is used for displaying the poetry full text corresponding to the target poetry entry and the explanation text of the poetry full text on the display screen of the dictionary pen.
13. A dictionary pen for text queries, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for:
responding to the scanning operation of the text to be recognized by using the dictionary pen, and acquiring the text to be recognized;
matching the text to be identified with preset poetry entries, and determining target poetry entries matched with the text to be identified, wherein the method specifically comprises the following steps of: performing clause processing on the text to be recognized according to characters and punctuation marks included in the text to be recognized to obtain the clause number of the text to be recognized; determining first poem entries according to the number of the clauses of the text to be identified, wherein the first poem entries are poem entries corresponding to the number of the clauses of the text to be identified; matching the text to be recognized with the first poetry term to obtain a first matching result with the first poetry term; determining a first poem term with a first matching result meeting a first preset condition as a target poem term matched with the text to be identified;
Acquiring an explanation text of the target poetry entry;
displaying the target poem entry and the interpretation text of the target poem entry on a display screen of the dictionary pen;
dividing the target poetry entry into at least one text unit, wherein each text unit comprises idioms, words or Chinese characters;
responding to the triggering operation of the target poetry entry through the display screen of the dictionary pen, and determining a text unit corresponding to the triggering operation;
acquiring an interpretation text of a text unit corresponding to the triggering operation;
and displaying the text unit corresponding to the triggering operation and the interpretation text of the text unit corresponding to the triggering operation on a display screen of the dictionary pen.
14. The dictionary pen of claim 13, wherein the processor is further specifically configured to execute the one or more programs including instructions for:
the matching of the text to be identified and the preset poem entry is performed, and the target poem entry matched with the text to be identified is determined, and the method further comprises the following steps:
when the first matching result of each first poem term does not accord with the first preset condition, determining a target poem term matched with the text to be identified by utilizing the clause included in the text to be identified.
15. The dictionary pen of claim 14, wherein the processor is further specifically configured to execute the one or more programs including instructions for:
the determining, by using the clause included in the text to be identified, a target poem entry matched with the text to be identified includes:
removing target clauses from the text to be recognized to generate partial text to be recognized, wherein the target clauses are respectively a first clause in the text to be recognized, a last clause in the text to be recognized, and the first clause and the last clause in the text to be recognized;
matching the part of the text to be recognized with second poetry entries to obtain second matching results of the second poetry entries, wherein the second poetry entries are poetry entries corresponding to the number of clauses of the part of the text to be recognized;
and determining a second poem term with a second matching result meeting a second preset condition as a target poem term matched with the text to be identified.
16. A dictionary pen as claimed in any one of claims 13 to 15 wherein the poetry entries include poetry entries, poetry title entries and poetry author entries.
17. The dictionary pen of claim 13, wherein the processor is further specifically configured to execute the one or more programs including instructions for:
the step of segmenting the target poetry term into at least one text unit includes:
if the target poetry entry comprises idioms, segmenting the idioms comprising the target poetry entry into text units;
if the part of the target poetry term except the idiom comprises a word, dividing the word included in the target poetry term into text units;
and dividing each Chinese character except idioms and words in the target poetry entry into text units.
18. The dictionary pen of claim 13, wherein the processor is further specifically configured to execute the one or more programs including instructions for:
when the target poetry term is a poetry term, acquiring the full text of the poetry corresponding to the target poetry term and the explanation text of the full text of the poetry;
and displaying the full text of the poem corresponding to the target poem and the explanation text of the full text of the poem on a display screen of the dictionary pen.
19. A computer-readable medium having instructions stored thereon, which when executed by one or more processors, cause an apparatus to perform the text query method of one or more of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010430240.0A CN111597324B (en) | 2020-05-20 | 2020-05-20 | Text query method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010430240.0A CN111597324B (en) | 2020-05-20 | 2020-05-20 | Text query method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111597324A CN111597324A (en) | 2020-08-28 |
CN111597324B true CN111597324B (en) | 2023-10-03 |
Family
ID=72185884
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010430240.0A Active CN111597324B (en) | 2020-05-20 | 2020-05-20 | Text query method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111597324B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113378566A (en) * | 2021-05-31 | 2021-09-10 | 安徽淘云科技股份有限公司 | Information content display method, device and equipment |
CN113641816A (en) * | 2021-08-20 | 2021-11-12 | 安徽淘云科技股份有限公司 | Information display method and device, storage medium and equipment |
CN113705205A (en) * | 2021-08-30 | 2021-11-26 | 安徽淘云科技股份有限公司 | Method, device, storage medium and equipment for repeatedly reminding new words by scanning |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012113352A (en) * | 2010-11-19 | 2012-06-14 | Casio Comput Co Ltd | Electronic dictionary device and program |
CN106951890A (en) * | 2017-02-16 | 2017-07-14 | 广东小天才科技有限公司 | Character recognition method and device of dictionary pen |
CN108399150A (en) * | 2018-02-07 | 2018-08-14 | 深圳壹账通智能科技有限公司 | Text handling method, device, computer equipment and storage medium |
CN109635091A (en) * | 2018-12-14 | 2019-04-16 | 上海钛米机器人科技有限公司 | A kind of method for recognizing semantics, device, terminal device and storage medium |
CN109766013A (en) * | 2018-12-28 | 2019-05-17 | 北京金山安全软件有限公司 | Poetry sentence input recommendation method and device and electronic equipment |
CN111178076A (en) * | 2019-12-19 | 2020-05-19 | 成都欧珀通信科技有限公司 | Named entity identification and linking method, device, equipment and readable storage medium |
-
2020
- 2020-05-20 CN CN202010430240.0A patent/CN111597324B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012113352A (en) * | 2010-11-19 | 2012-06-14 | Casio Comput Co Ltd | Electronic dictionary device and program |
CN106951890A (en) * | 2017-02-16 | 2017-07-14 | 广东小天才科技有限公司 | Character recognition method and device of dictionary pen |
CN108399150A (en) * | 2018-02-07 | 2018-08-14 | 深圳壹账通智能科技有限公司 | Text handling method, device, computer equipment and storage medium |
CN109635091A (en) * | 2018-12-14 | 2019-04-16 | 上海钛米机器人科技有限公司 | A kind of method for recognizing semantics, device, terminal device and storage medium |
CN109766013A (en) * | 2018-12-28 | 2019-05-17 | 北京金山安全软件有限公司 | Poetry sentence input recommendation method and device and electronic equipment |
CN111178076A (en) * | 2019-12-19 | 2020-05-19 | 成都欧珀通信科技有限公司 | Named entity identification and linking method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111597324A (en) | 2020-08-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10923118B2 (en) | Speech recognition based audio input and editing method and terminal device | |
CN111597324B (en) | Text query method and device | |
EP3173948A1 (en) | Method and apparatus for recommendation of reference documents | |
CN106446054B (en) | A kind of information recommendation method, device and electronic equipment | |
CN108304412B (en) | Cross-language search method and device for cross-language search | |
CN110704647B (en) | Content processing method and device | |
CN110633017B (en) | Input method, device and device for inputting | |
CN110391966B (en) | Message processing method and device and message processing device | |
CN109101505B (en) | Recommendation method, recommendation device and device for recommendation | |
CN111046210B (en) | Information recommendation method and device and electronic equipment | |
WO2023078414A1 (en) | Related article search method and apparatus, electronic device, and storage medium | |
CN112291614A (en) | Video generation method and device | |
CN107424612B (en) | Processing method, apparatus and machine-readable medium | |
WO2024149183A1 (en) | Document display method and apparatus, and electronic device | |
CN110929122B (en) | Data processing method and device for data processing | |
CN113033163B (en) | Data processing method and device and electronic equipment | |
CN109977390B (en) | Method and device for generating text | |
CN107784037B (en) | Information processing method and device, and device for information processing | |
KR102327790B1 (en) | Information processing methods, devices and storage media | |
CN111597325B (en) | Text query method and device | |
CN110858100B (en) | Method and device for generating association candidate words | |
CN112035628B (en) | Dialogue data cleaning method, device and storage medium | |
CN108983992B (en) | Candidate item display method and device with punctuation marks | |
CN108614831A (en) | Semantic primitive display methods and device, the device shown for semantic primitive | |
CN108108356A (en) | A kind of character translation method, apparatus and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |