CN115238135A - Computer implemented method for analyzing I-go problem and related product - Google Patents

Computer implemented method for analyzing I-go problem and related product Download PDF

Info

Publication number
CN115238135A
CN115238135A CN202210885722.4A CN202210885722A CN115238135A CN 115238135 A CN115238135 A CN 115238135A CN 202210885722 A CN202210885722 A CN 202210885722A CN 115238135 A CN115238135 A CN 115238135A
Authority
CN
China
Prior art keywords
tree structure
information
node
string information
identification
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.)
Pending
Application number
CN202210885722.4A
Other languages
Chinese (zh)
Inventor
刘使峻
郑可冠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Youdao Information Technology Beijing Co Ltd
Original Assignee
Netease Youdao Information Technology Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Youdao Information Technology Beijing Co Ltd filed Critical Netease Youdao Information Technology Beijing Co Ltd
Priority to CN202210885722.4A priority Critical patent/CN115238135A/en
Publication of CN115238135A publication Critical patent/CN115238135A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present invention provide a computer-implemented method for analyzing a go problem and related products. The method comprises the following steps: acquiring a file to be analyzed related to the go problem; generating a multi-branch tree structure related to the go problem based on the file to be analyzed; and analyzing the multi-branch tree structure to obtain the question types and answers of the I-go exercises. By the scheme, the analysis efficiency and the precision of the go problem can be effectively improved, and the technical implementation cost is reduced. Furthermore, embodiments of the present invention provide an apparatus and a computer-readable storage medium.

Description

Computer implemented method for analyzing I-go problem and related product
Technical Field
Embodiments of the present invention relate to the field of information processing technology, and more particularly, embodiments of the present invention relate to a method for analyzing a go problem implemented by a computer, an apparatus for performing the same, and a computer-readable storage medium.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein may include concepts that could be pursued, but are not necessarily ones that have been previously conceived or pursued. Thus, unless otherwise indicated herein, what is described in this section is not prior art to the description and claims in this application and is not admitted to be prior art by inclusion in this section.
With the vigorous development of the quality education industry, the online weiqi software also comes up endlessly. For these weiqi software, the function of weiqi exercise is an essential part, and it is often necessary to introduce weiqi exercise to assist in exercise. In the prior art, the introduction of the go problem is completed by mainly depending on manual analysis and configuration of the go problem through experience. The manual analysis mode not only influences the analysis efficiency and precision of the go problem, but also requires overhigh labor cost in the whole technology implementation process.
Disclosure of Invention
Known analysis of go problems is not ideal and is a very annoying process.
Therefore, an improved computer-implemented solution for analyzing go problems and related products are highly desirable, which can effectively improve the analysis efficiency and accuracy of go problems and reduce the technical implementation cost.
In this context, embodiments of the present invention contemplate a computer-implemented method for analyzing a go problem and related products.
In a first aspect of embodiments of the present invention there is provided a computer-implemented method for analyzing a go problem, comprising: acquiring a file to be analyzed related to the go problem; generating a multi-branch tree structure about the go problem based on the file to be analyzed; and analyzing the multi-branch tree structure to obtain the question types and answers of the go exercises.
In another embodiment of the present invention, wherein the file to be parsed includes an SGF formatted file including SGF string information for describing chess manual information of the go problem, and generating a multi-way tree structure for the go chess manual based on the file to be parsed includes: and generating the multi-branch tree structure based on the analysis of the SGF character string information.
In yet another embodiment of the present invention, parsing the multi-way tree structure to obtain question types and answers about the go problem comprises: searching identification information about question types from the multi-branch tree structure to determine question types of the go exercises based on the identification information; and extracting chess piece identification information and corresponding coordinate information from the multi-branch tree structure so as to determine an answer of the go problem based on the chess piece identification information and the corresponding coordinate information.
In yet another embodiment of the present invention, wherein the multi-way tree structure includes child nodes for storing the chess manual information, finding identification information about question types from the multi-way tree structure to determine question types of the go exercises based on the identification information comprises: performing cyclic analysis on child nodes in the multi-branch tree structure to search for type identifiers for marking question types; in response to finding the type identifier, extracting coordinate string information about the type identifier from child nodes of the multi-way tree structure; and determining the question type of the go exercise according to the type identification and the coordinate character string information thereof.
In one embodiment of the present invention, determining the answer to the go problem based on the piece identification information and the corresponding coordinate information thereof comprises: acquiring a plurality of node arrays of the multi-branch tree structure; extracting chess piece identification and corresponding coordinate character string information from each child node in each node array; and determining answers of the go exercises based on the extracted chess piece identifications and the corresponding coordinate character string information.
In another embodiment of the present invention, extracting the chess piece identification and the corresponding coordinate string information from each child node in each node array comprises: performing cyclic search on the child nodes in each node array until no child node is to be searched, and performing the following operations on each searched child node: extracting chess piece identification and coordinate character string information corresponding to the chess piece identification from each searched child node; storing the searched chess piece identification and the coordinate character string information corresponding to the chess piece identification into a corresponding node array; and responding to no child node to be searched in each node array, and filtering the data stored in each node array.
In yet another embodiment of the present invention, the method further comprises: extracting a target identification for marking whether the answer is valid or not from the multi-branch tree structure; the filtering processing of the data stored in each node array comprises: and filtering the data stored in each node array according to the target identification.
In another embodiment of the present invention, determining the answer to the go problem based on the extracted chess piece identifications and the coordinate string information corresponding to the chess piece identifications comprises: and assembling the data stored in all the filtered node arrays to obtain the answers of the go problem.
In one embodiment of the present invention, obtaining the plurality of node arrays of the multi-way tree structure comprises: and processing the multi-branch tree structure by using a depth-first search algorithm to obtain a plurality of node arrays.
In another embodiment of the present invention, the method further comprises: carrying out normalization verification on the SGF character string information; in response to the SGF string information being validated, performing a step of generating the multi-way tree structure based on parsing the SGF string information; or responding to the SGF character string information verification failure, and performing exception prompting.
In yet another embodiment of the present invention, parsing the multi-way tree structure comprises: and analyzing the multi-branch tree structure by adopting a JavaScript script.
In a second aspect of embodiments of the present invention, there is provided an apparatus comprising: a processor; and a memory storing computer instructions for analyzing a go problem, which when executed by the processor, cause the apparatus to perform a method according to the foregoing and a plurality of embodiments below.
In a third aspect of an embodiment of the present invention, there is provided a computer readable storage medium containing program instructions for analyzing a go problem, which when executed by a processor, cause the apparatus to perform a method according to the preceding and following embodiments.
According to the scheme implemented by the computer and used for analyzing the go problem and the related product thereof, the computer can be used for analyzing the go problem to obtain a multi-branch tree structure, and the problem type and the answer of the go problem are determined based on the multi-branch tree structure. According to the scheme, the corresponding question types and answers can be configured for the go exercises without manually analyzing the go exercises, so that the labor cost is greatly reduced, and the analysis efficiency and accuracy of the go exercises are effectively improved.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates a block diagram of an exemplary computing system 100 suitable for implementing embodiments of the present invention;
FIG. 2 schematically illustrates a flow diagram of a computer-implemented method for analyzing a go problem, in accordance with one embodiment of the present invention;
FIG. 3 schematically illustrates a flow diagram of a computer-implemented method for analyzing a go problem, according to another embodiment of the invention;
FIG. 4 is a flow diagram that schematically illustrates a method for analyzing a go problem using a JavaScript script in accordance with an embodiment of the present invention;
fig. 5A schematically illustrates parsing of a piece of SGF string information into a code according to an embodiment of the present invention;
FIG. 5B schematically shows a diagram of a parsing process of a multi-way tree structure according to an embodiment of the invention;
FIG. 5C is a diagram that schematically illustrates a result of a resolution of a multi-way tree structure, in accordance with an embodiment of the present invention;
FIG. 5D is a diagram that schematically illustrates results of parsing another piece of SGF string information, in accordance with an embodiment of the present invention; and
fig. 6 schematically shows a schematic block diagram of an apparatus according to an embodiment of the invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 illustrates a block diagram of an exemplary computing system 100 suitable for implementing embodiments of the present invention. As shown in fig. 1, computing system 100 may include: a Central Processing Unit (CPU) 101, a Random Access Memory (RAM) 102, a Read Only Memory (ROM) 103, a system bus 104, a hard disk controller 105, a keyboard controller 106, a serial interface controller 107, a parallel interface controller 108, a display controller 109, a hard disk 110, a keyboard 111, a serial external device 112, a parallel external device 113, and a display 114. Among these devices, coupled to the system bus 104 are a CPU 101, a RAM 102, a ROM 103, a hard disk controller 105, a keyboard controller 106, a serial controller 107, a parallel controller 108, and a display controller 109. The hard disk 110 is coupled to the hard disk controller 105, the keyboard 111 is coupled to the keyboard controller 106, the serial external device 112 is coupled to the serial interface controller 107, the parallel external device 113 is coupled to the parallel interface controller 108, and the display 114 is coupled to the display controller 109. It should be understood that the block diagram of the architecture depicted in FIG. 1 is for purposes of illustration only and is not intended to limit the scope of the present invention. In some cases, certain devices may be added or subtracted as the case may be.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, method or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.) or a combination of hardware and software, and is referred to herein generally as a "circuit," module "or" system. Furthermore, in some embodiments, the invention may also be embodied in the form of a computer program product in one or more computer-readable media having computer-readable program code embodied in the medium.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive example) of the computer readable storage medium may include, for example: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Embodiments of the present invention will be described below with reference to flowchart illustrations of methods and block diagrams of apparatuses (or systems) of embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
According to an embodiment of the present invention, a computer-implemented method and apparatus for analyzing a go problem is presented.
Moreover, any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present invention are explained in detail below with reference to several exemplary embodiments of the present invention.
Summary of The Invention
The inventor finds that the existing method for analyzing the go problem has low efficiency and precision and unsatisfactory analysis effect. For example, in the prior art, manual analysis of the go problem is mostly relied on, and problem types and answers need to be configured for the imported go problem, so that the whole analysis process of the go problem is long in period and large in error, and the actual requirement is difficult to meet. In addition, the inventor also finds that even though some methods for analyzing the go problem by using a machine exist, the methods are only limited to basic analysis of the go problem, and the analyzed content is often disordered, so that the problem type and the answer cannot be accurately analyzed, and the actual requirements cannot be met.
Based on the above, the inventor finds that the file to be analyzed (for example, an SGF-format file) of the go problem can contain various pieces of go chess manual information, and can implement accurate analysis of the go problem based on the file to be analyzed by a computer. Specifically, a multi-branch tree structure can be generated by using a file to be analyzed, so that question types and answers of the go problem can be obtained based on the analysis of the multi-branch tree structure, the analysis efficiency and the accuracy of the go problem can be effectively improved, and the technical implementation cost can be reduced.
Having described the basic principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Exemplary method
A computer-implemented method for analyzing a go problem according to an exemplary embodiment of the present invention is described below with reference to fig. 2. It should be noted that the embodiments of the present invention can be applied to any applicable scenarios.
FIG. 2 schematically illustrates a flow diagram of a computer-implemented method 200 for analyzing a go problem, in accordance with one embodiment of the present invention. It should be noted that the weiqi referred to in this application can be understood as various online strategic two-player chess games (which can be presented by various weiqi software in specific applications), which generally include chesses and a chessboard, and if necessary, record the information of the game using the chess manual. The Weiqi exercise can be understood as the exercise function which needs to be guided into the on-line Weiqi software to assist the Weiqi exercise therein.
As shown in fig. 2, at step S201, a file to be parsed about a go problem is acquired. The file to be analyzed can be understood as a file for recording information related to go exercises, such as a Smart Game Format (SGF) file, or other files capable of recording information related to go exercises. In some embodiments, there may be multiple ways to obtain the file to be parsed. For example, a file to be parsed uploaded by a user in real time may be obtained. For another example, a file to be parsed that is periodically imported by the server side may also be acquired. It can be understood that the description of the process of acquiring the file to be parsed is merely an exemplary illustration, and the manner and the number of acquiring the file to be parsed are not limited, and may be specifically set according to the application requirements.
Next, at step S202, a multi-way tree structure for the I-go problem may be generated based on the aforementioned document to be parsed. A multi-way tree structure is here understood to be a data structure that is similar to a file management system of a computer, and that contains a plurality of nodes that can store information that supports finding children from the root node down, and that also supports finding parents from children until the root node is found. And the multi-branch tree structure can cover various possibilities of analyzing the file to be analyzed to obtain an analysis result.
Next, at step S203, the aforesaid multi-branch tree structure can be parsed to obtain question types and answers about the go problem.
Therefore, the scheme of the invention does not rely on manual analysis of the go problem, but analyzes the file to be analyzed by means of the computer to determine the corresponding multi-branch tree structure, and accurately analyzes the question type and the answer of the go problem by utilizing the multi-branch tree structure. Therefore, analysis errors caused by human factors can be avoided, the analysis efficiency and the accuracy of the go problem are improved, and the labor cost can be reduced to reduce the technical implementation cost.
FIG. 3 schematically illustrates a flow diagram of a computer-implemented method 300 for analyzing a go problem, in accordance with another embodiment of the invention. It should be noted that the method 300 can be understood as a further supplement or extension to the method 200 in fig. 2. Therefore, the same applies to the following description in relation to the details of fig. 2.
As shown in FIG. 3, at step S301, an SGF format file for a go problem may be obtained. As described above, the file to be parsed may include an SGF format file or other format files, and fig. 3 specifically illustrates the SGF format file as an example. The SGF format file is designed for storing double chess game matching records, is usually in a plain text format, and the storage file of the matching information can be conveniently sent on the network and transmitted by using a text-based transmission protocol. In some embodiments, the SGF format file may include SGF string information describing the chess manual information of the go problem, which may in particular describe the chess manual information of the go problem by various indicia.
Next, at step S302, a multi-way tree structure may be generated based on the parsing of the SGF string information. In a specific implementation process, the SGF string information may be parsed into a multi-way tree structure in a variety of ways. For example, the SGF string information may be parsed by an open source library (e.g., sabaki's open source library) to obtain a multi-way tree structure. It should be noted that the description of the generation process of the multi-way tree structure is only an exemplary illustration, and may be specifically adjusted according to the format of the file to be parsed and the application requirements.
Next, at step S303, identification information about question types may be looked up from the aforementioned multi-way tree structure to determine question types of the go question based on the identification information. The multi-branch tree structure covers various possibilities of analyzing the SGF character string information to obtain an analysis result. For example, in some embodiments, the multi-way tree structure may include child nodes for storing the chess manual information. In practical application, the sub-nodes in the multi-branch tree structure can be circularly analyzed to search for the type identifier for marking the question type, and in response to the search for the type identifier, the coordinate character string information about the type identifier can be extracted from the sub-nodes in the multi-branch tree structure, and the question type of the go question can be determined according to the type identifier and the coordinate character string information thereof. It should be noted that the detailed description of the topic determination process is merely exemplary.
Then, at step S304, pieces identification information and their corresponding coordinate information may be extracted from the multi-way tree structure to determine an answer to the go problem based on the pieces identification information and their corresponding coordinate information. In some embodiments, a plurality of node arrays of the multi-way tree structure may be specifically obtained (for example, the multi-way tree structure may be processed by using a depth-first search algorithm to obtain a plurality of node arrays), and the chess piece identifier and the coordinate string information corresponding to the chess piece identifier are extracted from each node in each node array. For example, a cyclic search may be performed on the child nodes in each node array (the cyclic search process may specifically involve extracting the chess piece identifiers and the coordinate string information corresponding thereto from each searched child node, and then storing the searched chess piece identifiers and the coordinate string information corresponding thereto into the corresponding node array) until no child node is to be searched. And then responding to no child node to be searched in each node array, and filtering the data stored in each node array. After extracting the chess piece identification and the corresponding coordinate character string information from each child node is completed, an answer of the go problem can be determined based on the extracted chess piece identification and the corresponding coordinate character string information.
In some embodiments, the data stored in the node population may be filtered in a variety of ways. For example, a target identifier for marking whether the answer is valid or not may be extracted from the multi-way tree structure, and the data stored in each node array may be filtered according to the target identifier. It should be noted that the target identifier may be specifically adjusted according to the file format. For example, in the SGF format file, the target identifier may be an identifier C for marking whether the answer is valid. It should be noted that the detailed description of the filtering process is only an exemplary description, and the scheme of the present invention is not limited thereto.
Further, in some embodiments, the SGF string information may be subject to normative verification (e.g., verifying that the format in which the SGF string information is written complies with specifications, etc.). And in response to the SGF string information being verified, performing a step of generating a multi-way tree structure based on the parsing of the SGF string information. Therefore, the follow-up operation can be avoided being executed under the condition that the SGF character string information is not in a standard, and resource waste is reduced. In addition, in response to a failure in the SGF string information verification, an exception prompt is performed. Therefore, relevant personnel can conveniently perform corresponding maintenance according to the abnormal prompt.
In the actual application process, the file to be analyzed and the multi-branch tree structure can be analyzed through multiple language scripts. For example, the parsing may be performed using a high-level language such as JavaScript script, java, or Rust. The following takes JavaScript script as an example and combines fig. 4 to fig. 5D to further explain the scheme of the present invention.
FIG. 4 is a flow chart that schematically illustrates a method for analyzing a go problem using JavaScript in accordance with an embodiment of the present invention. It should be noted that fig. 4 can be understood as a possible technical implementation process for analyzing the go problem in fig. 2 and 3. Therefore, the same applies to the following description in connection with the relevant details in fig. 2 and 3.
As shown in fig. 4, the function portal of the answer may be invoked as a front end and/or a server by a unified portal method (createAnswer as illustrated). Specifically, the SGF string information to be analyzed may be input into the createan Answer for analysis (for example, normative analysis of the SGF string information, generation of a multi-branch tree structure, and analysis by using node attributes in the multi-branch tree structure, etc.), and the Answer and the question type obtained through analysis may be placed in an Answer Array. The analyzing process of the createAnswer for the SGF string information specifically can involve the following steps:
and (1) analyzing the SGF character string information by utilizing a SaBiki open source library. In particular, it may involve serializing, recursively analyzing, and matching SGF string information to generate a multi-way tree array sgfNode. Fig. 5A shows a process of parsing a piece of SGF string information into a code. The related SGF character string information specifically comprises: (please remember the order of the fixed formula) AB [ dd ] [ fc ] [ cc ] LB [ dd:1] [ cf:2] [ fc:3] [ bd:4] [ cc:5] [ ci:6] AW [ cf ] [ bd ] [ ci ] POS [ aa: mm ] A P [ Sabaki:0.52.0] PL [ B ], AE [ dd ] [ cf ] [ bd ] [ cc ] [ ci ], B [ dd ], W [ cf ], B [ fc ], W [ bd ], B [ cc ], W [ c ], C [ c ]. Through the parsing of the SGF string information, a code as shown in fig. 5A is generated (the meaning of each identifier shown in fig. 5A may specifically refer to the specification of the SGF string information). In addition, if an exception occurs in the process of analyzing the SGF character string information, the fact that the exception does not meet the specification can be identified, and exception prompt can be performed through a corresponding code at the moment.
And (2) verifying the integrity of the sgfNode, and extracting the multi-branch tree structure in the array.
And (3) performing loop analysis on the child nodes in the multi-branch tree structure to find out the type identifier (such as the CR/MA identifier) for marking the topic type. In some embodiments, if the CR/MA identifier is found, it indicates that the type identifier exists, and extracts and returns coordinate string information about the type identifier.
And (4) if the type identifiers such as CR/MA and the like cannot be found in the step (3), continuing to analyze the array, and calling a getSgfTypeKey method to recursively verify the matching target identifiers (for example, the identifier C used for marking whether the answer is valid or not). If the C identifier is found, the result can be returned as a parameter and transmitted to the subsequent analysis flow of the dfsteeList method. FIG. 5B schematically shows a parsing process of a multi-way tree structure according to an embodiment of the invention. Specifically, the code generated in fig. 5A is analyzed to find the CR/MA identifier therein, and no relevant field exists in the code in fig. 5A, so it is determined that no needed identifier is found, and the next analysis is directly skipped to perform. Then, the getSgfTypeKey is called to verify whether the C identifier exists, and when the fact that the failure is responded is found through the getSgfTypeKey, the fact that the C identifier does not exist is proved. At this time, dfsteelist is called to perform recursion operation, and after the recursion is completed, the result shown in fig. 5B is returned.
And (5) after the processing of the steps is finished, starting the depth-first search algorithm of the multi-branch tree by a dfstreeList method. Specifically, the node group may be circulated first, and the dfsTree method may be called to recurse the child nodes to collect answer information, in this process, a recursion level is optimized using the circulation, and branches under each child node are searched down all the time in the circulation process until no child node is found.
Step (6), in the dfsTree method, getItem can be called to extract chess piece identification (such as B/W mark) inside a node and obtain corresponding coordinate character string information to be stored in an array, and if no child node exists, a matched processing method is called through sgfTypeKey to filter the result.
And (7) if the child node exists, transmitting the execution result of the getItem method to the dfsTree method as a parameter, starting the flow of the subsequent circulation of the child node, and calling the dfsTree method to repeatedly execute the step (6) and the step (7).
And (8) after the processing is finished, returning to the dfsTreeList for result assembly, and finally feeding back an analysis result to the answer array of the answer array through createAnswer. Fig. 5C schematically shows a result of parsing of a multi-way tree structure according to an embodiment of the present invention. Specifically, only one execution result is determined according to the analysis results illustrated in fig. 5A and 5B. Therefore, after the execution is completed, the execution results may be spliced, and then the type identifier (e.g., field identifier AE) in which the identification question type is the play question is found, thereby verifying and determining the play type that is a response play question, and finally generating the response result as shown in fig. 5C.
In another embodiment, the SGF string information to be analyzed is assumed to be (CA [ gb2312] AB [ rc ] [ qc ] [ pc ] [ qd ] AW [ rd ] [ qe ] [ pd ] [ oc ] C [ black first, please break white chess ] AP [ MultiGo:4.4.4] SZ [19] ]AB [ qb ] MULTIGOGM [0] (; B [ pe ] C [ RIGHT ]), where (; B [ pe ] C [ RIGHT ]) includes a target identifier C [ RIGHT ] indicating that the answer is valid, and the analysis result for the SGF string information is as shown in FIG. 5D, and a valid answer portion indicated by the target identifier C [ RIGHT ] is retained.
It should be noted that the above various analysis processes performed by the JavaScript script can greatly reduce the development complexity of the front-end project and reduce the useless work, and do not need to increase too much configuration. In addition, the reusability is effectively improved, the SGF format file which accords with the correct specification can be analyzed and processed, and the method and the device can be applied to environments such as service end node. Specifically, in the application process, the functions of automatic question type identification result generation and batch import can be realized, the configuration efficiency of question types and answers of various exercises can be improved in service, and meanwhile, the cost required by the configuration exercise can be reduced. In addition, the method for analyzing the go problem based on the JavaScript language can be applied to an applet, a PC browser, a mobile browser and an App, so that the processing of the scene related to the go problem is more convenient.
Of course, various analysis processes performed by JavaScript script are only exemplary, and similar analysis may be performed on SGF format files by using high-level languages such as Java or Rust, and the specific need is to adjust according to the processing principle of compiling SGF by different servers (for example, extra bottom layer implementation processes may be involved, and the cost of converting SGF by a server end is increased, etc.).
Exemplary device
Having described the method of an exemplary embodiment of the present invention, next, a description will be given of a computer-implemented related product for analyzing a go problem of an exemplary embodiment of the present invention with reference to fig. 6.
Fig. 6 schematically shows a schematic block diagram of an apparatus 600 according to an embodiment of the present invention. As shown in fig. 6, device 600 may include a processor 601 and a memory 602. Wherein the memory 602 stores computer instructions implemented by a computer for analyzing a go problem, which when executed by the processor 601, cause the apparatus 600 to perform a method according to the foregoing as described in connection with figures 2 and 3. For example, in some embodiments, device 600 may perform the retrieval of a file to be parsed for a go problem, the generation of a multi-way tree structure, the parsing of a multi-way tree structure, and the like. Based on this, the device 600 can obtain answers and question patterns of the maintenance questions by analyzing the multi-branch tree structure determined by the file to be analyzed, so that the analysis efficiency and accuracy of the go questions can be effectively improved, and the technical implementation cost can be reduced.
In some implementation scenarios, the device 600 may include a device with information interaction and information processing functions (e.g., a tablet, a terminal such as a mobile phone or other smart device, a server, etc.), and the present invention does not limit the structural design that the device 600 may have.
It should be noted that although in the above detailed description several means or sub-means of the device are mentioned, this division is only not mandatory. Indeed, the features and functions of two or more of the devices described above may be embodied in one device, according to embodiments of the invention. Conversely, the features and functions of one apparatus described above may be further divided into embodiments by a plurality of apparatuses.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Use of the verbs "comprise", "comprise" and their conjugations in this application does not exclude the presence of elements or steps other than those stated in this application. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (10)

1. A computer-implemented method for analyzing a go problem, comprising:
acquiring a file to be analyzed related to the go problem;
generating a multi-branch tree structure related to the go problem based on the file to be analyzed; and
and analyzing the multi-branch tree structure to obtain the question type and the answer of the go problem.
2. The method of claim 1, wherein the file to be parsed comprises an SGF formatted file including SGF string information describing chess manual information of the go problem, and wherein generating a multi-way tree structure for the go chess manual based on the file to be parsed comprises:
and generating the multi-branch tree structure based on the analysis of the SGF character string information.
3. The method of claim 2, wherein parsing the multi-way tree structure to obtain question patterns and answers for the go problem comprises:
searching identification information about question types from the multi-branch tree structure to determine question types of the go exercises based on the identification information; and
and extracting chess piece identification information and corresponding coordinate information from the multi-branch tree structure so as to determine an answer of the go problem based on the chess piece identification information and the corresponding coordinate information.
4. The method of claim 3, wherein the multi-way tree structure includes child nodes for storing the chess manual information, and wherein searching the multi-way tree structure for identification information about question types to determine question types of the go question based on the identification information comprises:
performing cyclic analysis on child nodes in the multi-branch tree structure to search for type identifiers for marking question types;
in response to finding the type identifier, extracting coordinate string information about the type identifier from child nodes of the multi-way tree structure; and
and determining the question type of the go question according to the type identification and the coordinate character string information thereof.
5. The method of claim 4, wherein determining answers to the go problem based on the piece identification information and its corresponding coordinate information comprises:
acquiring a plurality of node arrays of the multi-branch tree structure;
extracting chess piece identification and corresponding coordinate character string information from each child node in each node array; and
and determining answers of the go exercises based on the extracted chess piece identifications and the corresponding coordinate character string information.
6. The method of claim 5, wherein extracting a pawn identification and its corresponding coordinate string information from each child node in each of the node arrays comprises:
performing cyclic search on the child nodes in each node array until no child node is to be searched, and performing the following operations on each searched child node:
extracting chess piece identification and coordinate character string information corresponding to the chess piece identification from each searched child node; and
storing the searched chess piece identification and the coordinate character string information corresponding to the chess piece identification into a corresponding node array;
and responding to no child node to be searched in each node array, and filtering the data stored in each node array.
7. The method of claim 6, further comprising:
extracting a target identification for marking whether the answer is valid or not from the multi-branch tree structure;
the filtering processing of the data stored in each node array comprises:
and filtering the data stored in each node array according to the target identification.
8. The method of claim 7, wherein determining answers to the go problem based on the extracted piece identifiers and their corresponding coordinate string information comprises:
and assembling the data stored in all the filtered node arrays to obtain the answers of the go problem.
9. An apparatus, comprising:
a processor; and
a memory storing computer instructions for analyzing a go problem, which when executed by the processor, cause the apparatus to perform the method of any one of claims 1-8.
10. A computer readable storage medium containing program instructions for analyzing a go problem, which when executed by a processor, cause the method according to any one of claims 1-8 to be carried out.
CN202210885722.4A 2022-07-26 2022-07-26 Computer implemented method for analyzing I-go problem and related product Pending CN115238135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210885722.4A CN115238135A (en) 2022-07-26 2022-07-26 Computer implemented method for analyzing I-go problem and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210885722.4A CN115238135A (en) 2022-07-26 2022-07-26 Computer implemented method for analyzing I-go problem and related product

Publications (1)

Publication Number Publication Date
CN115238135A true CN115238135A (en) 2022-10-25

Family

ID=83674687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210885722.4A Pending CN115238135A (en) 2022-07-26 2022-07-26 Computer implemented method for analyzing I-go problem and related product

Country Status (1)

Country Link
CN (1) CN115238135A (en)

Similar Documents

Publication Publication Date Title
US11507354B2 (en) Blackbox matching engine
US20200293433A1 (en) Automating Identification of Test Cases for Library Suggestion Models
US20200264870A1 (en) Automating Generation of Library Suggestion Engine Models
US10732966B2 (en) Library model addition
US11429586B2 (en) Expression update validation
CN108984389B (en) Application program testing method and terminal equipment
US20160306736A1 (en) Translation verification testing
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN115803734A (en) Natural language enrichment using action interpretation
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
US11500619B1 (en) Indexing and accessing source code snippets contained in documents
CN112199261A (en) Application program performance analysis method and device and electronic equipment
CN112363939A (en) Method, system and equipment for quickly generating fuzzy test network protocol template
CN117493158A (en) Test method and device, electronic equipment and storage medium
CN115437930B (en) Webpage application fingerprint information identification method and related equipment
CN115238135A (en) Computer implemented method for analyzing I-go problem and related product
CN115757174A (en) Database difference detection method and device
CN114721932B (en) Data processing method, device, equipment and storage medium
CN105245380B (en) Message propagation mode identification method and device
CN114817024A (en) Use case generation method and device, equipment and storage medium
CN113672233A (en) Server out-of-band management method, device and equipment based on Redfish
CN112506923A (en) Method, device and electronic equipment for determining corresponding service method call link
CN101334738A (en) Techniques for parsing electronic files
WO2024067039A1 (en) Application automated testing method, electronic device, and computer readable medium
CN113220307B (en) Optimization method and device for code coverage analysis and electronic 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