CN106021220B - Table detection method and device - Google Patents
Table detection method and device Download PDFInfo
- Publication number
- CN106021220B CN106021220B CN201610383604.8A CN201610383604A CN106021220B CN 106021220 B CN106021220 B CN 106021220B CN 201610383604 A CN201610383604 A CN 201610383604A CN 106021220 B CN106021220 B CN 106021220B
- Authority
- CN
- China
- Prior art keywords
- condition
- formatted text
- format
- hand over
- data
- 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
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
The present invention provides a kind of table detection method and device, for Table Design formatted text, parses to the formatted text, is detected according to parsing result to table.It during being somebody's turn to do, does not need to carry out particular arrangement for the table of game plan, it is only necessary to automatically formatted text parse and detect corresponding table by writing correct formatted text, reduce the complexity of table detection.Moreover, when table changes, it is only necessary to carry out corresponding small change to formatted text, the maintenance cost of formatted text is relatively small.In addition, the syntax format of formatted text is relatively easy, so that the personnel for being unfamiliar with programming with Fast Learning and can also grasp.
Description
Technical field
The present embodiments relate to development of games technology more particularly to a kind of table detection method and device.
Background technique
Game plan is the personnel for being responsible for game design and planning in electronic game development teams, is that electronic game is developed
Core.In electronic game development process, the design of table needed for game is completed in game plan, designed table is by programming personnel
Game is imported, the process for importing table is referred to as to lead table.
Due to the particularity of table and the presence of artificial origin, it often will appear mistake during game plan design table (schedule)
Accidentally, it will be apparent that fail to fill in lead again with format error etc. and found in time because of fault interrupt during table.However, some hidden
Property mistake, such as numerical value fills out and wrong can not be found during leading table.In order to avoid there are problems for table, currently, being familiar with branch
The programming personnel for holding Excel file read-write capability programming language writes relative program for table, by the relative program to table
Lattice are detected, and are adjusted by iteration to table, and then adjust relative program, last output test result.
In above table detection process, need to write relative program, the corresponding relative program of different tables for table
Difference, leads to that the coupling of relative program and table is excessively high, poor universality.
Summary of the invention
The present invention provides a kind of table detection method and device, generates formatted text for table, to formatting text
This is parsed, and is detected according to parsing result to table.
In a first aspect, the embodiment of the present invention provides a kind of table detection method, comprising:
Formatted text is obtained, the formatting is herein for describing the condition that the data in table to be detected are met;
The formatted text is parsed, format parameter is obtained, the format parameter is the formatted data of dictionary format;
According to the format parameter, hand over word, the function in hand over word callable function library are generated;
The table to be detected is detected according to the hand over word.
Optionally, in an embodiment of the present invention, the formatted text includes at least one of: filename
Between title, table name, gauge outfit and table, wherein
The gauge outfit includes gauge outfit condition, and the gauge outfit condition is used to indicate the item of the satisfaction of the column data in the table
Part, a column data are any one column data in the table;
Comprising condition between table between the table, condition is used to indicate between at least two column datas in the table between the table
The condition of satisfaction.
Optionally, in an embodiment of the present invention, the gauge outfit condition includes at least one of: monadic operation rule
Then with column data operation rule.
Optionally, in an embodiment of the present invention,
Condition includes at least one of: numerical operation rule and logical operation rule between the table.
Optionally, in an embodiment of the present invention, the function library, includes at least: calling for the hand over word, for real
The function of existing operation rule.
Optionally, in an embodiment of the present invention, the dictionary format is specially python dictionary format.
Optionally, in an embodiment of the present invention, the table is detected according to the hand over word, specifically:
According to the hand over word, detect whether the column data in the table meets the gauge outfit condition, and/or, inspection
Whether each data surveyed in multi-column data meet condition between the table.
Optionally, in an embodiment of the present invention, the formatted text at least two;The parsing formatting
Text, before obtaining format parameter, further includes:
At least two formatted texts are normalized.
Optionally, in an embodiment of the present invention, the formatted text is the formatted text of Json format, described
The formatted text of Json format describes the table in the form of key-value pair.
Second aspect, the embodiment of the present invention provide a kind of table detection device, comprising:
Module is obtained, for obtaining formatted text, the formatting is herein for describing the data in table to be detected
The condition met;
Parsing module obtains format parameter, the format parameter is dictionary format for parsing the formatted text
Formatted data;
Hand over word generation module, for generating hand over word, hand over word callable function library according to the format parameter
In function;
Detection module, for being detected according to the hand over word to the table to be detected.
Optionally, in an embodiment of the present invention, the formatted text includes at least one of: filename
Between title, table name, gauge outfit and table, wherein
The gauge outfit includes gauge outfit condition, and the gauge outfit condition is used to indicate the item of the satisfaction of the column data in the table
Part, a column data are any one column data in the table;
Comprising condition between table between the table, condition is used to indicate between at least two column datas in the table between the table
The condition of satisfaction.
Optionally, in an embodiment of the present invention, the gauge outfit condition includes at least one of: monadic operation rule
Then with column data operation rule.
Optionally, in an embodiment of the present invention, condition includes at least one of: numerical operation rule between the table
It is then regular with logical operation.
Optionally, in an embodiment of the present invention, the function library, includes at least: calling for the hand over word, for real
The function of existing operation rule.
Optionally, in an embodiment of the present invention, the dictionary format is specially python dictionary format.
Optionally, in an embodiment of the present invention, the detection module is specifically used for detecting institute according to the hand over word
State whether the column data in table meets the gauge outfit condition, and/or, whether each data detected in multi-column data meet
Condition between the table.
Optionally, in an embodiment of the present invention, the formatted text at least two, described device further include:
Processing module, for parsing the formatted text in the parsing module, before obtaining format parameter, at least
Two formatted texts are normalized.
Optionally, in an embodiment of the present invention, the formatted text is the formatted text of Json format, described
The formatted text of Json format describes the table in the form of key-value pair.
Table detection method and device provided in an embodiment of the present invention, for Table Design formatted text, to the format
Change text to be parsed, table is detected according to parsing result.Should during, do not need table for game plan into
Row particular arrangement, it is only necessary to parsing be carried out to formatted text automatically and to corresponding table by the way that correct formatted text is arranged
Lattice are detected, and the complexity of table detection is reduced.Moreover, when table changes, it is only necessary to carry out phase to formatted text
The small change answered does not need in addition to write new test code, and the maintenance cost of formatted text is relatively small.In addition, lattice
The syntax format of formula text is relatively easy, so that the personnel for being unfamiliar with programming with Fast Learning and can also grasp.
Detailed description of the invention
Fig. 1 is the process schematic of current game table detection;
Fig. 2 is the flow chart of table detection method embodiment one of the present invention;
Fig. 3 is the detection process schematic diagram of table detection method of the present invention;
Fig. 4 is the structural schematic diagram of table detection device embodiment one of the present invention;
Fig. 5 is the structural schematic diagram of table detection device embodiment two of the present invention.
Specific embodiment
In general, the table in electronic game includes numerical tabular and demand schedule.Wherein, numerical tabular is game plan to trip
The table that numerical value in play is defined;Demand schedule be game plan cooperate plot, partial content is described in the form of text and
Obtained table.For example, following table 1 is the numerical tabular enumerated, table 2 is the demand schedule enumerated.
Table 1
Speed | Blood volume | Physical attacks | Magic arts attack | Attenuation ratio |
141 | 1333 | 1032 | 1000 | 0.5 |
142 | 1355 | 1033 | 1000 | 0.6 |
143 | 1333 | 1032 | 2000 | 0.7 |
144 | 1355 | 1032 | 2000 | 0.7 |
145 | 1333 | 1032 | 2000 | 0.8 |
146 | 1355 | 1032 | 2000 | 0.7 |
147 | 1333 | 1032 | 2000 | 0.7 |
148 | 1355 | 1032 | 2000 | 0.7 |
149 | 1396 | 1032 | 2000 | 0.7 |
Table 2
It should be noted that numerical tabular, based on numerical value, demand schedule is based on plot, still, a table in many cases
Possible existing numerical value has plot again in lattice, separates not stringent.For example, " talking in bout " one arranges in above-mentioned table 2,
It is existed simultaneously for session (plot) and probability (numerical value).
In general, most of numerical tabular is table related using Excel etc. as carrier to demand schedule.Due to Excel etc.
The particularity of table and think reason, can inevitably malfunction when making numerical tabular and demand schedule, for example numerical value is filled in mistake, failed to fill in
Deng.Some minor errors, such as apparent format error, fail to fill in during leading table and can be sent out in time because of fault interrupt
It is existing.However, some stronger mistakes of concealment, such as numerical value are filled out wrong, size setting mistake etc. and can not be sent out during leading table
It is existing, cause game the loss for being difficult to retrieve occur.Therefore, it during game making, needs to the table in game, i.e. numerical tabular
It is detected with demand schedule.
In addition, game plan is often related to the scene of the Numerical Controls such as technical ability, attribute, position when making table,
Need to meet specific rule in terms of relationship of these numerical value between value type, numberical range, different data, at this point, equally
It needs to detect table.
Currently, most of programming language both provides the read-write capability of Excel file, as Python xlrd, C++XLW,
Java POI etc., the Data Detection that Excel table is carried out using these libraries that programming personnel can be convenient, specifically, reference can be made to
Fig. 1, Fig. 1 are the process schematic of current game table detection.
Fig. 1 is please referred to, the personnel of Excel file and numerical value rule is familiar with, relative program is write based on table, pass through the phase
It closes program to detect Excel table, table variation is carried out according to detection, and then adjustment relative program is changed according to table.
During being somebody's turn to do, table is adjusted by iteration, and then adjusts relative program, last output test result.
Above-mentioned detection method can detect Excel table under most of running environment, independent of Excel
Office software leads to the coupling of relative program and table however, it is desirable to write different relative programs for different tables
Excessively high, poor universality, and then the complexity for causing table to detect is high.When numerical value setting or Excel numerical value tables change,
Need to adjust corresponding relative program.In addition, it is necessary to which testing staff is familiar with programming knowledge, while being familiar with the specific rule of table
Then, the cost is relatively high.
In view of this, the embodiment of the present invention provides a kind of table detection method and device, the complexity of table detection is reduced.
Specifically, reference can be made to Fig. 2 and Fig. 3.
Fig. 2 is the flow chart of table detection method embodiment one of the present invention, and Fig. 3 is the detection of table detection method of the present invention
Process schematic.The present embodiment includes the following steps:
101, formatted text is obtained, the formatted text is for describing the item that the data in table to be detected are met
Part.
In the embodiment of the present invention, modeling analysis is carried out to table, such as numerical tabular or demand schedule, obtains relatively popularized pass
Key word and syntax rule.For example, tester such as uses text formatting --- the JavaScript of lightweight according to language syntax
Object representation (JavaScript Object Notation, JSON), describes table in the form of key-value pair, to obtain Json
Format arrives formatted text, and the condition met for describing the data in table to be detected, which is stored in
On memory.In this step, formatted text is obtained by reading memory etc..In general, for detecting the format of table
Changing text can be including at least condition between file name, table (sheet) title, gauge outfit condition and table.Specifically, gauge outfit includes table
Top part, the gauge outfit condition are used to indicate the condition of the satisfaction of the column data in table, wherein a column data is appointing in table
It anticipates a column data;Comprising condition between table between table, between the table, condition is used to indicate meets between at least two column datas in table
Rule.Formatted text is exemplified below:
Wherein, gauge outfit condition includes at least one of: monadic operation rule and column data operation rule, item between table
Part includes at least one of: numerical operation rule and logical operation rule.
In general, for the ease of multiple person cooperational, formatting can be write herein by multiple plannings, then, for
For one table, the formatted text of the table can be one or more.When formatted text is multiple, executing
Parsing formatted text described in 102, before obtaining format parameter, it is also necessary to which at least two formatted texts are normalized
Processing, the i.e. formatted text of rejecting redundancy merge annexable format text.
For example:
The formatted text one write by user A is obtained, as follows:
The formatted text two write by user B is obtained, as follows:
Formatting after being normalized is herein below:
102, the formatted text is parsed, format parameter is obtained, the format parameter is the formatted data of dictionary format.
In this step, formatted text is parsed using programming languages such as Python, format parameter is obtained, that is, obtains
The format parameter of dict format in python.Wherein, format parameter is the formatted data of dictionary format, for example, text will be formatted
Originally it is parsed into the text of python format, for the formatted data after being loaded to formatted text, such as filename: sheet:
{ regular 1:{ }, regular 2:{ } ..., regular 3:{ } ... etc..
Specific procedure process is for example are as follows:
Checkfilelist () # checks all formatting text;
Json.load (ejsonfile) # utilizes python build-in function load format text, i.e. ejson text (this
Place is example, needs to load because having many ejsonfile in practice);
Checkjsonfile () # checks the formatted text after load;
Combjsonfile () # merges all formatting text;
The table parameter of all ejson files to be resolved may finally be obtained.
103, according to the format parameter, hand over word, the function in hand over word callable function library are generated.
In this step, every format parameter will be further parsed by python dictionary format by custom function library
Hand over word.
In this step, format parameter is further parsed into the hand over word of dictionary format, this turn by custom function library
Escape can call the function in the function library.
Specific: hand over word is made of dictionary (dict) and list (list) combination, the composition of hand over word and format parameter
It is similar, but hand over word includes the pointer of a large amount of processing function, these pointers are directed toward each processing in custom function library
Function, the function library, includes at least: calling, for hand over word for realizing the function of operation rule.
Wherein, custom function library stores multiple basic functions, those basic functions be abstracted in detection process,
The function for needing to use in detection process, the pointer of those basic functions each mean the specific letter in custom function library
Number.
It is above-mentioned according to format parameter, parse the specific procedure process of hand over word for example are as follows: specific procedure process
Condition between # breakdown top news part and table,
for key,value in tabledict.items():
Every table rule process of #, the processing of gauge outfit condition
header_dict_to_funs(colname,value)
# is if there is condition between table, and conditional compilation is converted between table
if tabledict.has_key(ejson_const.RULES):
# numerical operation rule parsing
MATHparser(keyword,rules_value_dict)
The parsing of # logic rules
CONDparser(rules_value_dict)
# returns to each table interior coding rule
returnretdict
104, the table to be detected is detected according to the hand over word.
In this step, table is read in using programming languages such as Python, for example, reading in entire table or only reading in part number
According to arranging and being cached, the every data for reading in table is detected using the hand over word in step 103, and output data item
Whether mesh meets the format of formatted text.
The above-mentioned specific procedure process detected according to the hand over word to the table is for example are as follows:
# takes out every data
Elementlist=sheetdata.row_values (iter)
# initialization condition detection, if can skip
if tabeldict.has_key(ejson_const.SKIPPED):
#skip
In the # data, every gauge outfit condition detection
for key,value in tabeldict.items():
Flag=col_element_dict_fun (value, element)
#flag is True or False, and wherein True is that the data meets current gauge outfit condition, is otherwise jumped out
Condition detects between the table of # table data
if tabeldict.has_key(ejson_const.RULES):
Condition detects between every table of #
for rule in rules_list:
The following process detection numerical value of # calculates and logic rules
Flag=multi_col_element_dict (rule, elementlist, coldict)
Table detection method provided in an embodiment of the present invention, for Table Design formatted text, to the formatted text
It is parsed, table is detected according to parsing result.During being somebody's turn to do, it is special not need to carry out for the table of game plan
Configuration, it is only necessary to parsing be carried out to formatted text automatically and to the progress of corresponding table by the way that correct formatted text is arranged
Detection reduces the complexity of table detection.Moreover, when table changes, it is only necessary to be carried out to formatted text corresponding small
Change, does not need in addition to write new test code, the maintenance cost of formatted text is relatively small.In addition, formatting text
This syntax format is relatively easy, so that the personnel for being unfamiliar with programming with Fast Learning and can also grasp.
In general, to the detection of table, need to complete the detection of condition between gauge outfit condition and/or table, for example, gauge outfit item
The detection of monadic operation rule, column data operation rule in part, for another example, the numerical operation between table in condition is regular and/or patrols
Collect the detection of operation rule.For each detection, formatted text all includes three basic keywords: type (type) cuckoo
It then, must (required) sub-rule and optional (optional) sub-rule.Wherein, type indicates specific type, such as whole
Type (INT), the condition that required sub-rule specification data must comply with, it includes condition combined by " and ",
Optional sub-rule be it is optional, it includes condition pass through " or " combination.For example, the monadic operation rule that gauge outfit condition includes
Formatted text then is as follows:
In the following, above-mentioned each rule is described in detail.
Firstly, monadic operation is regular.
Specifically, monadic operation rule is for the detection to cell in table.Type that monadic operation rule includes
Whether the content in rule detection cell meets the type of feature, such as integer type (INT), floating type type (FLOAT), word
Symbol string (STR), array (TUPLE) and special separators numerical value, as SEGM (fixed number of ", " separators
Field), SEMI (", ", the field for being not fixed number of separators).It is exemplified below:
In the regular corresponding formatted text of above-mentioned monadic operation, values is Optional Field, exclusively for array
The type of matter, as TUPLE, SEGM, SEMI are designed.The keyword for including in Required sub-rule and optional sub-rule
There are several types of types:
1, numerical value comparative type, as >=, > ,==,!=, <=, <.Numerical value comparative type mainly acts on integer
And floating point type, key are keyword, are worth specifically to compare numerical value, numerical value comparative type predominantly detects the table of value type.
2, aggregate type, such as in, ref.Aggregate type is suitable for most of categorical data, predominantly detects whether table is deposited
In specific array (in) or other exterior chain data (ref), wherein ref support array, that is, exist in multiple exterior chains.
3, character string type, such as null, pattern, character string type data are also applied for most of categorical data, main
Detect whether character string meets specific setting.Wherein, null is indicated whether to allow as sky, and pattern is regular expression.
In the following, illustrating by taking a specific table as an example to monadic operation rule, specifically, reference can be made to table 3.
Table 3
Role ID | Role's title | Grade | Attack | Dialogue |
1001 | Sun Wukong | 15 | 1033 | It is dialogue herein |
1002 | One of the chief characters in "Pilgrimage To The West" who was supposedly incarnated through the spirit of pig, a symbol of man's cupidity | 15 | 1000 | It is dialogue herein |
1003 | Tang's monk | 15 | 500 | It is dialogue herein |
1004 | Husky monk | 15 | 600 | It is dialogue herein |
1005 | White Longma | 15 | 600 | It is dialogue herein |
1006 | Kwan-yin | 15 | 500 | It is dialogue herein |
1007 | The Jade Emperor | 15 | 400 | It is dialogue herein |
1008 | The Lady Queen Mother | 15 | 600 | It is dialogue herein |
Assuming that the setting rule of table 3 is as follows: 100 > grade > 0 need to be met, role's title is not sky, while attack >
300, then the formatted text for meeting the requirement is as follows:
In table detection process, each column data in table 3 is detected according to above-mentioned formatted text.
Secondly, column data operation rule.
Specifically, column data operation rule predominantly detects column data set, i.e., detection is when whether forefront meets with target column
Connection relationship, such as left connection (left join), right connection (right join) and full connection (full join).Equally with
For above-mentioned table 3, it is assumed that the setting of table 3 rule is as follows: ID, which is arranged, to be needed to meet right joint angle color table and defends the doctrine table .id, then format
Change text is write as follows:
The data that above-mentioned formatted text is used to detect role ID column cannot be sky, while meet right joint angle color table shield
Method table .id.
Finally, compound operation is regular.
Specifically, whether compound operation rule meets setting rule for detection two and more than two different column datas,
Specially two kinds of operation relation, i.e. numerical operation rule and logical operation rule.
Data operation rule is the calculated relationship between the multiple row of same data, such as plus is subtracted, multiplication and division arithmetic
Rule, it includes different lines (header) and nested (NEST) data, final checkout result be need to meet required and
The setting of optional.For example, the corresponding formatted text of numerical operation rule is as follows:
In the following, illustrating by taking a specific table as an example to the data operation rule in compound operation rule, specifically
, reference can be made to table 4.
Table 4
Numerical operation rule refers to for the computation rule of each data setting in table, wherein each data refers to
Data line in table.Assuming that the setting rule of table 4 is as follows: (fiery attribute+water attribute+penus+metallicity+wood belongs to SUM
Property) × attenuation ratio > 300, that is to say, that the data in table 4, the corresponding gold of associative skills, wood, water, fire, soil summation after with decline
As a result the product for subtracting ratio is greater than 300, be otherwise unsatisfactory for setting, report an error.Then corresponding formatted text is as follows:
In above-mentioned formatted text, the key assignments such as 0,1,2 are parameter position, which can be understood as * in LISP
(+a, b, c, d) q, i.e. (a+b+c+d+e) × q > 300, when being unsatisfactory for this setting, report an error.
The cardinal principle of logical operation rule is condition-> conclusion, and when condition is set up, conclusion must be set up, otherwise not
Meet detection;When condition is invalid, then do not have to detect conclusion.
In the following, illustrating by taking a specific table as an example to the logical operation rule in compound operation rule, specifically
, reference can be made to table 5.
Table 5
Formation | Type | Attack |
Rosefinch battle array | 1 | 60 |
Black Warrior battle array | 2 | 20 |
White tiger battle array | 3 | 200 |
Green Dragon battle array | 4 | 150 |
Assuming that the setting rule of table 5 is as follows: in formation table, when type is 3 and 4, i.e., when formation is white tiger and Green Dragon battle array,
Attack is greater than 100, and when synchronic typological is 1 and 2, less than 100. formatted texts of attack are as follows:
Above-mentioned formatted text can be understood as needing full when type meets correlated condition (type column data is 3 or 4)
Demand in the foot required and optional field parallel with cond, i.e. attack column data are greater than 100.
Fig. 4 is the structural schematic diagram of table detection device embodiment one of the present invention.Table detection dress provided in this embodiment
It sets, can realize each step for the method applied to table detection device that any embodiment of that present invention provides.Specifically, this
Embodiment provide table detection device include:
Module 11 is obtained, for obtaining formatted text, the formatting is herein for describing the number in table to be detected
According to the condition met;
Parsing module 12 obtains format parameter, the format parameter is dictionary format for parsing the formatted text
Formatted data;
Hand over word generation module 13, for generating hand over word, the hand over word callable function according to the format parameter
Function in library;
Detection module 14, for being detected according to the hand over word to the table to be detected.
Table detection device provided in an embodiment of the present invention, for Table Design formatted text, to the formatted text
It is parsed, table is detected according to parsing result.During being somebody's turn to do, it is special not need to carry out for the table of game plan
Configuration, it is only necessary to parsing be carried out to formatted text automatically and to the progress of corresponding table by the way that correct formatted text is arranged
Detection reduces the complexity of table detection.Moreover, when table changes, it is only necessary to be carried out to formatted text corresponding small
Change, does not need in addition to write new test code, the maintenance cost of formatted text is relatively small.In addition, formatting text
This syntax format is relatively easy, so that the personnel for being unfamiliar with programming with Fast Learning and can also grasp.
Optionally, in an embodiment of the present invention, the formatted text includes at least one of: filename
Between title, table name, gauge outfit and table, wherein
The gauge outfit includes gauge outfit condition, and the gauge outfit condition is used to indicate the item of the satisfaction of the column data in the table
Part, a column data are any one column data in the table;
Comprising condition between table between the table, condition is used to indicate between at least two column datas in the table between the table
The condition of satisfaction.
Optionally, in an embodiment of the present invention, the gauge outfit condition includes at least one of: monadic operation rule
Then with column data operation rule.
Optionally, in an embodiment of the present invention, condition includes at least one of: numerical operation rule between the table
It is then regular with logical operation.
Optionally, in an embodiment of the present invention, the function library, includes at least: calling for the hand over word, for real
The function of existing operation rule.
Optionally, in an embodiment of the present invention, the dictionary format is specially python dictionary format.
Optionally, in an embodiment of the present invention, the detection module 14 is specifically used for according to the hand over word, detection
Whether the column data in the table meets the gauge outfit condition, and/or, whether each data detected in multi-column data are full
Condition between the foot table.
Fig. 5 is the structural schematic diagram of table detection device embodiment two of the present invention.In the present embodiment, the formatted text
At least two, on the basis of the present embodiment device shown in Fig. 4, further further include:
Processing module 15 is right before obtaining format parameter for parsing the formatted text in the parsing module 12
At least two formatted texts are normalized.
Optionally, in an embodiment of the present invention, the formatted text is the formatted text of Json format, described
The formatted text of Json format describes the table in the form of key-value pair.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (12)
1. a kind of table detection method characterized by comprising
Formatted text is obtained, the formatting is herein for describing the condition that the data in table to be detected are met;
The formatted text is parsed, format parameter is obtained, the format parameter is the formatted data of dictionary format;
According to the format parameter, hand over word, the function in hand over word callable function library are generated;
The table to be detected is detected according to the hand over word;
The formatted text includes at least one of: between file name, table name, gauge outfit and table, wherein
The gauge outfit includes gauge outfit condition, and the gauge outfit condition is used to indicate the condition of the satisfaction of the column data in the table,
One column data is any one column data in the table;
Comprising condition between table between the table, between the table, condition, which is used to indicate between at least two column datas in the table, meets
Condition;
The gauge outfit condition includes at least one of: monadic operation rule and column data operation rule;The column data
Operation rule detection is when whether forefront and target column meet connection relationship;
Condition includes at least one of: numerical operation rule and logical operation rule between the table.
2. the method according to claim 1, wherein the function library, includes at least: supplying the hand over word tune
With, for realizing the function of operation rule.
3. the method according to claim 1, wherein the dictionary format is specially python dictionary format.
4. having the method according to claim 1, wherein being detected according to the hand over word to the table
Body are as follows:
According to the hand over word, detect whether the column data in the table meets the gauge outfit condition, and/or, it detects more
Whether each data in column data meet condition between the table.
5. the method according to claim 1, wherein the formatted text at least two;The parsing institute
Formatted text is stated, before obtaining format parameter, further includes:
At least two formatted texts are normalized.
6. the method according to claim 1, wherein the formatted text is the formatting text of Json format
This, the formatted text of the Json format describes the table in the form of key-value pair.
7. a kind of table detection device characterized by comprising
Module is obtained, for obtaining formatted text, data of the formatting herein for describing in table to be detected expire
The condition of foot;
Parsing module obtains format parameter, the format parameter is the format of dictionary format for parsing the formatted text
Data;
Hand over word generation module, for according to the format parameter, generating hand over word, in hand over word callable function library
Function;
Detection module, for being detected according to the hand over word to the table to be detected;
The formatted text includes at least one of: between file name, table name, gauge outfit and table, wherein
The gauge outfit includes gauge outfit condition, and the gauge outfit condition is used to indicate the condition of the satisfaction of the column data in the table,
One column data is any one column data in the table;
Comprising condition between table between the table, between the table, condition, which is used to indicate between at least two column datas in the table, meets
Condition;
The gauge outfit condition includes at least one of: monadic operation rule and column data operation rule;The column data
Operation rule detection is when whether forefront and target column meet connection relationship;
Condition includes at least one of: numerical operation rule and logical operation rule between the table.
8. device according to claim 7, which is characterized in that the function library includes at least: supplying the hand over word tune
With, for realizing the function of operation rule.
9. device according to claim 7, which is characterized in that the dictionary format is specially python dictionary format.
10. device according to claim 7, which is characterized in that
The detection module, is specifically used for according to the hand over word, detect the column data in the table whether meet it is described
Gauge outfit condition, and/or, whether each data detected in multi-column data meet condition between the table.
11. device according to claim 7, which is characterized in that the formatted text at least two, described device is also
Include:
Processing module, for parsing the formatted text in the parsing module, before obtaining format parameter, at least two
Formatted text is normalized.
12. device according to claim 7, which is characterized in that the formatted text is the formatting text of Json format
This, the formatted text of the Json format describes the table in the form of key-value pair.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610383604.8A CN106021220B (en) | 2016-06-01 | 2016-06-01 | Table detection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610383604.8A CN106021220B (en) | 2016-06-01 | 2016-06-01 | Table detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106021220A CN106021220A (en) | 2016-10-12 |
CN106021220B true CN106021220B (en) | 2019-03-19 |
Family
ID=57093263
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610383604.8A Active CN106021220B (en) | 2016-06-01 | 2016-06-01 | Table detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106021220B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790683B (en) * | 2017-02-10 | 2019-12-17 | 合一网络技术(北京)有限公司 | Network data display method and device based on mobile terminal |
CN107608951B (en) * | 2017-09-22 | 2021-12-21 | 上海金智晟东电力科技有限公司 | Report generation method and system |
CN108170118A (en) * | 2017-11-30 | 2018-06-15 | 中冶南方(武汉)自动化有限公司 | Electric vehicle controller automatically testing platform and method |
CN109446493B (en) * | 2018-10-17 | 2022-06-24 | 网易(杭州)网络有限公司 | Data processing method, data processing apparatus, storage medium, and electronic apparatus |
CN110008446A (en) * | 2019-02-27 | 2019-07-12 | 深圳点猫科技有限公司 | The method and electronic equipment that a kind of language based on programming converts form document |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567299A (en) * | 2010-12-14 | 2012-07-11 | 微软公司 | Using text messages to interact with spreadsheets |
CN102855229A (en) * | 2011-06-30 | 2013-01-02 | 镇江雅迅软件有限责任公司 | Self-defined statistical report form generating system based on EXCEL form |
US8874620B1 (en) * | 2011-06-15 | 2014-10-28 | Amazon Technologies, Inc. | Data transfer optimization |
CN105094843A (en) * | 2015-08-20 | 2015-11-25 | 网易(杭州)网络有限公司 | Data sheet inspection method and device |
CN105117378A (en) * | 2015-08-05 | 2015-12-02 | 联动优势电子商务有限公司 | Method and apparatus for converting JSON file into EXCEL file |
-
2016
- 2016-06-01 CN CN201610383604.8A patent/CN106021220B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567299A (en) * | 2010-12-14 | 2012-07-11 | 微软公司 | Using text messages to interact with spreadsheets |
US8874620B1 (en) * | 2011-06-15 | 2014-10-28 | Amazon Technologies, Inc. | Data transfer optimization |
CN102855229A (en) * | 2011-06-30 | 2013-01-02 | 镇江雅迅软件有限责任公司 | Self-defined statistical report form generating system based on EXCEL form |
CN105117378A (en) * | 2015-08-05 | 2015-12-02 | 联动优势电子商务有限公司 | Method and apparatus for converting JSON file into EXCEL file |
CN105094843A (en) * | 2015-08-20 | 2015-11-25 | 网易(杭州)网络有限公司 | Data sheet inspection method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106021220A (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106021220B (en) | Table detection method and device | |
US10740541B2 (en) | Fact validation in document editors | |
Baek et al. | Knowledge-augmented language model prompting for zero-shot knowledge graph question answering | |
CN106202153B (en) | A kind of the spelling error correction method and system of ES search engine | |
CN103493041B (en) | Use the automatic sentence evaluation device of shallow parsing device automatic evaluation sentence and error-detecting facility thereof and method | |
US20160124936A1 (en) | Grammar compiling methods, semantic parsing methods, devices, computer storage media, and apparatuses | |
JP5788953B2 (en) | Error recognition method and apparatus for speech recognition | |
CN101441623B (en) | Translation device, and information processing method | |
US20220035799A1 (en) | Bridge from natural language processing engine to database engine | |
CN101595474A (en) | Language analysis | |
CN102033879A (en) | Method and device for identifying Chinese name | |
JP2009140499A (en) | Method and apparatus for training target language word inflection model based on bilingual corpus, tlwi method and apparatus, and translation method and system for translating source language text into target language | |
CN103020045B (en) | Statistical machine translation method based on predicate argument structure (PAS) | |
EP3945431A1 (en) | Bridge from natural language processing engine to database engine | |
CN112949286B (en) | Automatic Chinese syntax analyzer based on sentence pattern structure | |
JP5766152B2 (en) | Language model generation apparatus, method and program | |
CN110232117A (en) | Sentence fluency detection method, device and terminal | |
Dary et al. | Dependency parsing with backtracking using deep reinforcement learning | |
JP2013134753A (en) | Wrong sentence correction device, wrong sentence correction method and program | |
CN102138141A (en) | Approximate collation device, approximate collation method, program, and recording medium | |
CN109445881A (en) | Script operation method, device, electronic equipment and storage medium | |
US20210374133A1 (en) | Bridging textual and tabular data for cross domain text-to-query language semantic parsing with a pre-trained transformer language encoder and anchor text | |
JP2022091121A (en) | Text error correction method, apparatus, electronic device, storage medium, and program | |
US6742164B1 (en) | Method, system, and program for generating a deterministic table to determine boundaries between characters | |
De Kok et al. | Natural language processing for the working programmer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |