Automatic calculating method under Text Mode and system
Technical field
The present invention relates to a kind of automatic calculating method, the automatic calculating method particularly under a kind of Text Mode and system.
Background technology
Along with popularizing of intelligent artifact, information content form of communication is also more and more diversified, the man-machine interaction business such as Web bank, mobile phone payment, mobile-phone payment, mobile phone speculation in stocks, TV payment are also at development, and often need to use computing function in these business, people realize real-time computing function in information input and editing process has become a kind of general demand.
But, existing Text Mode interface is all separated with computing module usually, such as, in the text edit mode of SMS, when relating to calculating in input text process, usually first to be switched to counter interface and carry out computing, and then the operation result of counter is copied turn back in corresponding text, complex operation, if when relating to many calculating in text, frequently to switch in text and counter, Consumer's Experience is poor.
Summary of the invention
The present invention is for solving the problem, provide the automatic calculating method under a kind of Text Mode and system, by identifying calculative calculating formula in Text Mode, realize the automatic computing of calculating formula and operation result is back in text, solving the problem switched between Text Mode and computation schema loaded down with trivial detailsly.
For achieving the above object, the technical solution used in the present invention is:
An automatic calculating method under Text Mode, is characterized in that, comprises the following steps:
10. input calculating formula in the text mode;
The end identifier of the described calculating formula of 20. identification;
Described calculating formula before end identifier described in 30. acquisitions;
40. call calculator interface carries out automatic computing to described calculating formula, and is returned by operation result and show in the text.
Preferably, described end identifier is "=", " altogether ", " equaling ", " total ", " amounting to " or its synonym.
Preferably, in described step 30, after the described calculating formula before the end identifier described in acquisition, the calculating formula that further highlighted display obtains.
Preferably, in described step 30, described calculating formula before end identifier described in acquisition, mainly by detect in Text Entry and whether the character judging current input is end identifier, if, then straight line from this end identifier, until the character running into first nonnumeric NOR-operation symbol, and the character field obtained between the character of this first nonnumeric NOR-operation symbol and described end identifier is as described calculating formula.
Preferably, in described step 40, call calculator interface and automatic computing is carried out to described calculating formula, mainly described calculating formula is sent to calculator modules by described calculator interface, calculator modules carries out Data Analysis and automatic computing according to described calculating formula, obtains operation result.
Preferably, in described step 40, operation result is returned and shows in the text, after mainly described operation result being back to described end identifier, and the operation result described in highlighted display.
Preferably, when user does not need described operation result, then continue input text and operation result described in covering, or operation result described in deleting continue input text; User need revise described in operation result time, then cursor is navigated in the middle of operation result and cancels highlighted display and operation result of modifying; When user accepts described operation result, then cancel the highlighted display of operation result after cursor being moved to described operation result.
In addition, present invention also offers the Automatic computing system under a kind of Text Mode, it is characterized in that, it comprises:
Load module, for inputting calculating formula in the text mode;
End identifier identification module, for identifying the end identifier of described calculating formula;
Calculating formula acquisition module, for obtaining the described calculating formula before described end identifier;
Computing module, carries out automatic computing for calling calculator interface to described calculating formula, and is returned by operation result and show in the text.
The invention has the beneficial effects as follows:
Automatic calculating method under a kind of Text Mode of the present invention and system, it is by inputting calculating formula in the text mode, and identify the end identifier of described calculating formula, described calculating formula before end identifier described in acquisition, then call calculator interface and automatic computing is carried out to described calculating formula, and operation result is returned and shows in the text; Thus without the need to frequently switching between Text Mode and computation schema, carrying out the demand of automatic computing after achieving user version input calculating formula, simplifying operation logic, for user decreases operation steps and running time, pointed out the experience of user.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the general flow chart of the automatic calculating method under a kind of Text Mode of the present invention;
Fig. 2 is the structural representation of the Automatic computing system under a kind of Text Mode of the present invention;
Fig. 3 is the text interface schematic diagram after the input calculating formula of the present invention one specific embodiment;
Fig. 4 is the text interface schematic diagram returned after operation result of the present invention one specific embodiment.
Embodiment
In order to make technical matters to be solved by this invention, technical scheme and beneficial effect clearly, understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
As shown in Figure 1, the automatic calculating method under a kind of Text Mode of the present invention, it comprises the following steps:
10. input calculating formula (as shown in Figure 3) in the text mode;
The end identifier of the described calculating formula of 20. identification;
Described calculating formula before end identifier described in 30. acquisitions;
40. call calculator interface carries out automatic computing to described calculating formula, and is returned by operation result and show (as shown in Figure 4) in the text.
In the present embodiment, described end identifier is "=", " altogether ", " equaling ", " total ", " amounting to " or its synonym, whether it is end identifier or its synonym to carry out intelligent decision by the character inputted each, if then further straight line numeral or operational symbol, if do not search numeral or operational symbol, stop automatic computing, if search numeral or operational symbol, then continue the calculating formula described in obtaining.
In described step 30, after described calculating formula before end identifier described in acquisition, the calculating formula that further highlighted display obtains, the operation result that user can be allowed to get information about automatically demonstrate carries out computing to which calculating formula and drawn, and whether its calculating formula obtained is complete or correct to make user to judge intuitively, thus can judge that whether the operation result obtained based on this calculating formula is correct intuitively; In described step 30, described calculating formula before end identifier described in acquisition, mainly by detect in Text Entry and whether the character judging current input is end identifier, if, then straight line from this end identifier, until run into the character of first nonnumeric NOR-operation symbol, and the character field obtained between the character of this first nonnumeric NOR-operation symbol and described end identifier is as described calculating formula.
In described step 40, call calculator interface and automatic computing is carried out to described calculating formula, mainly described calculating formula is sent to calculator modules by described calculator interface, calculator modules carries out Data Analysis and automatic computing according to described calculating formula, obtains operation result; In described step 40, operation result is returned and shows in the text, after mainly described operation result being back to described end identifier, and the operation result described in highlighted display; When user does not need described operation result, then continue input text and operation result described in covering, or operation result described in deleting continue input text; User need revise described in operation result time, then cursor is navigated in the middle of operation result and cancels highlighted display and operation result of modifying; When user accepts described operation result, then cancel the highlighted display of operation result after cursor being moved to described operation result.
As shown in Figure 2, present invention also offers the Automatic computing system under a kind of Text Mode, it comprises:
Load module A, for inputting calculating formula in the text mode;
End identifier identification module B, for identifying the end identifier of described calculating formula;
Calculating formula acquisition module C, for obtaining the described calculating formula before described end identifier;
Computing module D, carries out automatic computing for calling calculator interface to described calculating formula, and is returned by operation result and show in the text.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For system class embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
And, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.In addition, one of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
Above-mentioned explanation illustrate and describes the preferred embodiments of the present invention, be to be understood that the present invention is not limited to the form disclosed by this paper, should not regard the eliminating to other embodiments as, and can be used for other combinations various, amendment and environment, and can in invention contemplated scope herein, changed by the technology of above-mentioned instruction or association area or knowledge.And the change that those skilled in the art carry out and change do not depart from the spirit and scope of the present invention, then all should in the protection domain of claims of the present invention.