Method and device for analyzing text to key value pairs

A text parsing and text technology, applied in the field of data processing, can solve problems such as the decline of parsing efficiency, and achieve the effect of improving flexibility and parsing efficiency

Active Publication Date: 2013-12-18
ADVANCED NEW TECH CO LTD
View PDF3 Cites 19 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0010] To sum up, the existing method of parsing text into key-value pairs needs to search the text character by character to determine the text format, and after the search, it is necessary to determine the variable format according to the complex text format, and then after determining the variable format , it is necessary to extract the strings corresponding to these variables, and then assign them to form key-value pairs, that is, the existing method of parsing text into key-value pairs requires many times of full traversal
However, when the text format is very complex (for example, with multiple delimiters), and the text length is very long (for example, the length of the substring is very long), multiple full traversals will lead to a significant drop in parsing efficiency

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for analyzing text to key value pairs
  • Method and device for analyzing text to key value pairs
  • Method and device for analyzing text to key value pairs

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0072] In order to make the above objects, features and advantages of the present application more obvious and comprehensible, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0073] The embodiment of the present application uses a text analysis template to describe the format of the text to be processed and the format of the target key-value pair, and uses the text analysis template to match the text to be processed to extract valuable information to implement text analysis. Compared with multiple full traversals in the prior art, only one full traversal is needed to match the text analysis template and the text to be processed in this application, so the parsing efficiency can be effectively improved, especially when the text format is very complicated or the text length is very long , the present application has a more significant advantage of improving the analysis efficien...

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

PUM

No PUM Login to view more

Abstract

The invention provides a method and a device for analyzing text to key value pairs. The methods mainly includes presetting a text analyzing template of text formats; using the text analyzing template for describing formats of text to be processed and formats of target key value pairs; compiling the text analyzing template of the text formats to acquire compiled results recognizable to computer programs; matching in the text to be processed according to source variable and separators to acquire value of the source variable; reserving the source variable the same with target variable and corresponding value as key value pairs corresponding to the text to be processed. The compiled results include the source variable and the separators corresponding to the text formats to be processed. The method and the device can improve efficiency of analyzing the text to the key value pairs.

Description

technical field [0001] The present application relates to the technical field of data processing, in particular to a method and device for parsing text into key-value pairs. Background technique [0002] Key-value (Key-value) pair is a data storage structure of computer programs, which can quickly and uniquely locate a key-value (value) through a primary key (key), in scenarios that require fast search and one-to-one data storage has been widely used. [0003] In practical applications, there is often a need to extract valuable information from a piece of text and store it in the form of key-value pairs. For example, the text to be processed is "icbc001,123456", which hides information such as channel number (api) and serial number (no), and needs to be extracted to form the following key-value pair {api:icbc001,no :123456}. [0004] By analyzing the format of the text to be processed, it can be known that the text is a character string separated by a predetermined symbol...

Claims

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/22
Inventor 王尹
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products