CN110427328A - Text handling method, device, equipment and storage medium - Google Patents

Text handling method, device, equipment and storage medium Download PDF

Info

Publication number
CN110427328A
CN110427328A CN201910724673.4A CN201910724673A CN110427328A CN 110427328 A CN110427328 A CN 110427328A CN 201910724673 A CN201910724673 A CN 201910724673A CN 110427328 A CN110427328 A CN 110427328A
Authority
CN
China
Prior art keywords
random
text
character string
text information
preset length
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
CN201910724673.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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910724673.4A priority Critical patent/CN110427328A/en
Publication of CN110427328A publication Critical patent/CN110427328A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Abstract

The embodiment of the present disclosure provides a kind of text handling method, device, equipment and storage medium, this method comprises: obtaining the text information in Text Entry;If it is determined that the character string of preset length meets default replacement logic in the text information, the character string of the preset length is then substituted for and is preset matched random text information in random writing system, wherein, the character string of the preset length is the character string before the cursor in the Text Entry.The embodiment of the present disclosure, which is able to solve, rapidly to realize the input of test data, simultaneously because the untrue property of test data is manually entered, lead to the problem of test effect difference.

Description

Text handling method, device, equipment and storage medium
Technical field
The embodiment of the present disclosure relates to field of computer technology more particularly to a kind of text handling method, device, equipment and storage Medium.
Background technique
It is higher and higher to the quality requirement of software in industry with the continuous development of software development technique, writing code When, when being especially used for test-purpose, in order to save testing cost, automatization testing technique is widely used, and generallys use Test case document is write first, then writes the mode of script, this side using automated test tool for use-case one by one Formula causes test case document to separate with test script, when changing more in software development, needs to update use-case document simultaneously With modification test script, it is be easy to cause the inconsistent of use-case document and test script, is unfavorable for use-case document and test script Maintenance.
Traditional test is generally based on manual test, it is possible to reduce the redundancy of automatized script, and can pass through Addition annotation improves readability, but existing manual test is frequently necessary to that a large amount of virtual data (mock is manually entered Data), these inputs are very troublesome, and are easy error, if arbitrarily input, and test data can be allowed to seem untrue, it leads Cause test effect bad.
Therefore, currently used test method can not rapidly realize the input of test data.
Summary of the invention
The embodiment of the present disclosure provides a kind of text handling method, device, equipment and storage medium, with overcome the prior art without Method rapidly realizes the problem of input of test data.
In a first aspect, the embodiment of the present disclosure provides a kind of text handling method, comprising:
Obtain the text information in Text Entry;
If it is determined that the character string of preset length meets default replacement logic in the text information, then by the preset length Character string be substituted for and preset matched random text information in random writing system, wherein the character of the preset length String is the character string before the cursor in the Text Entry.
In a kind of possible design, the character string of preset length meets default replacement in the determination text information Logic, comprising:
When the character string of the preset length includes configurable wake-up symbol and configurable keyword, determine described pre- If the character string of length meets default replacement logic.
It is described if it is determined that the character string of preset length meets default replace in the text information in a kind of possible design Logic is changed, then the character string of the preset length is substituted for and is preset matched random text information in random writing system, Include:
If it is determined that the character string of preset length meets default replacement logic in the text information, then start timing;
When timing time reaches preset time, then the character string of the preset length is substituted for and is preset random text system Matched random text information in system.
In a kind of possible design, the character string by the preset length is substituted for and presets random writing system In matched random text information, comprising:
By the configurable wake-up symbol, the event for presetting random writing system is called in triggering;
The random text letter corresponding with the configurable keyword is obtained in random writing system from described preset Breath;
The character string that the random text information is replaced to the preset length, in the Text Entry described in display Random text information.
In a kind of possible design, random text system is substituted for and preset in the character string by the preset length In system after matched random text information, the method also includes:
The cursor is moved to the text end of the random text information, to indicate that replacement operation is completed.
In a kind of possible design, the configurable keyword includes at least one of following: Universally Unique Identifier, Name, timestamp, head portrait, image, random text.
Second aspect, the embodiment of the present disclosure provide a kind of text processing apparatus, comprising:
Module is obtained, for obtaining the text information in Text Entry;
Logic execution module is replaced, the character string for the preset length in determining the text information meets default replacement When logic, the character string of the preset length is substituted for and is preset matched random text information in random writing system, In, the character string of the preset length is the character string before the cursor in the Text Entry.
In a kind of possible design, the replacement logic execution module is specifically used for:
When the character string of the preset length includes configurable wake-up symbol and configurable keyword, determine described pre- If the character string of length meets default replacement logic.
In a kind of possible design, the replacement logic execution module is specifically used for:
When the character string of preset length meets default replacement logic in determining the text information, start timing;
When timing time reaches preset time, then the character string of the preset length is substituted for and is preset random text system Matched random text information in system.
In a kind of possible design, the replacement logic execution module, also particularly useful for:
By the configurable wake-up symbol, the event for presetting random writing system is called in triggering;
From the configurable pass preset and obtained in random writing system in the character string with the preset length The corresponding random text information of keyword;
The character string that the random text information is replaced to the preset length, in the Text Entry described in display Random text information.
In a kind of possible design, described device further include: cursor mobile module;
The cursor mobile module, for being substituted for and presetting random text in the character string by the preset length In system after matched random text information, the cursor is moved to the text end of the random text information, with table Show that replacement operation is completed.
In a kind of possible design, the configurable keyword includes at least one of following: Universally Unique Identifier, Name, timestamp, head portrait, image, random text.
The third aspect, the embodiment of the present disclosure provide a kind of text-processing equipment, comprising: at least one processor and storage Device;
The memory stores computer executed instructions;
At least one described processor executes the computer executed instructions of memory storage so that it is described at least one Processor executes text handling method described in the various possible designs of first aspect and first aspect as above.
Fourth aspect, the embodiment of the present disclosure provide a kind of computer readable storage medium, the computer-readable storage medium Computer executed instructions are stored in matter, when processor execute the computer executed instructions when, realize first aspect as above with And text handling method described in the various possible designs of first aspect.
Text handling method, device, equipment and the storage medium that the embodiment of the present disclosure provides first obtain in Text Entry Text information, however, it is determined that in the text information be located at the Text Entry in cursor before preset length character String meets default replacement logic, then by the character string of the preset length be substituted for and preset in random writing system it is matched with Machine text information.The embodiment of the present disclosure is by obtaining the text information in Text Entry, to judge in the text information Whether the character string of the preset length before the cursor in the Text Entry meets default replacement logic, if described pre- If the character string of length meets default replacement logic, then the default replacement logic is executed i.e. by the character string of the preset length It is substituted for and is preset matched random text information in random writing system, rapidly realizes the input of test data, and test Data are more true relative to test data is manually entered, and then improve test effect.
Detailed description of the invention
In order to illustrate more clearly of the embodiment of the present disclosure or technical solution in the prior art, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this public affairs The some embodiments opened for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow diagram for the text handling method that the embodiment of the present disclosure provides;
Fig. 2 is the flow diagram for the text handling method that another embodiment of the disclosure provides;
Fig. 3 is the flow diagram for the text handling method that the another embodiment of the disclosure provides;
Fig. 4 a is the schematic diagram for the text handling method that the embodiment of the present disclosure provides;
Fig. 4 b is the schematic diagram for the text handling method that the another embodiment of the disclosure provides;
Fig. 4 c is the schematic diagram for the text handling method that disclosure another embodiment provides;
Fig. 4 d is the schematic diagram for the text handling method that another embodiment of the disclosure provides;
Fig. 4 e is the schematic diagram for the text handling method that another embodiment of the disclosure provides;
Fig. 4 f is the schematic diagram for the text handling method that the another embodiment of the disclosure provides;
Fig. 4 g is the schematic diagram for the text handling method that disclosure another embodiment provides;
Fig. 4 h is the schematic diagram for the text handling method that another embodiment of the disclosure provides;
Fig. 5 is the hardware structural diagram for the text processing system that the embodiment of the present disclosure provides;
Fig. 6 is the structural block diagram for the text processing apparatus that the embodiment of the present disclosure provides;
Fig. 7 is the structural block diagram for the text processing apparatus that the another embodiment of the disclosure provides;
Fig. 8 is the hardware structural diagram for the electronic equipment that the embodiment of the present disclosure provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present disclosure clearer, below in conjunction with the embodiment of the present disclosure In attached drawing, the technical solution in the embodiment of the present disclosure is clearly and completely described, it is clear that described embodiment is Disclosure a part of the embodiment, instead of all the embodiments.Based on the embodiment in the disclosure, those of ordinary skill in the art Every other embodiment obtained without creative efforts belongs to the range of disclosure protection.
The specification and claims of the disclosure and term " first ", " second ", " third " " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so as to embodiment of the disclosure described herein, such as can be with Sequence other than those of illustrating or describing herein is implemented.In addition, term " includes " and " having " and their times What is deformed, it is intended that cover it is non-exclusive include, for example, contain the process, method of a series of steps or units, system, Product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include be not clearly listed or for The intrinsic other step or units of these process, methods, product or equipment.
In the prior art, user is when writing code, when being especially used for test-purpose, it is often necessary to be manually entered a large amount of Virtual data (mock data), such as name, place, picture address, mailbox, timestamp etc..These inputs are very troublesome, And it is easy error, if arbitrarily input, and test data can be allowed to seem untrue, cause test effect bad, for example, " A name " column, test data are likely to the text that user at will gets on keyboard, such as " algorithm is big local (sfddf) ", " Leave and have rejected (lkjjl) " etc..In order to rapidly realize the input of test data, and make test data seem it is relatively true, It is more intuitive.The embodiment of the present disclosure provides a kind of text handling method to solve the above problems.
With reference to Fig. 1, Fig. 1 is the text handling method flow diagram that the embodiment of the present disclosure provides.The embodiment of the present disclosure Method can be applied in terminal device or server, i.e. executing subject can be terminal device and be also possible to server, herein Without limitation.This article treatment method includes:
Text information in S101, acquisition Text Entry.
In the embodiments of the present disclosure, the Text Entry when text information is shown in user's test software or program Interior, therefore, in practical applications, terminal device or server need to monitor in real time defeated with the presence or absence of user in Text Entry The text information entered, the text information can be test data.During the test, if monitoring user that text information is defeated Enter into the Text Entry, then obtains the text information that user inputs in Text Entry.Specifically, text envelope Breath can be the test containing any one of Universally Unique Identifier, name, timestamp, head portrait, image, random text keyword Data.
S102, if it is determined that the character string of preset length meets default replacement logic in the text information, then will be described pre- If the character string of length is substituted for and presets matched random text information in random writing system, wherein the preset length Character string be cursor in the Text Entry before character string.
It is based in Text Entry before executing default replacement logic to text information in the embodiment of the present disclosure Cursor position, to determine the character string of the preset length in text information, i.e., the preset length in the described text information Character string continues to judge whether the character string of the preset length meets default before the cursor in the Text Entry Replace logic.
In practical applications, the text handling method is practical solves text replacement or test data is rapidly input Method improves the scheme of text input experience in editing machine, can be applied to test-purpose.In order to realize the fast of test data Speed input, and guarantee the authenticity and intuitive of test data, the character string that can be replaced in text information is replaced with default The specified new character strings of rule, save the time.In order to reduce the maloperation of replacement, need to be determined according to current cursor position User is the character string thought in replacement text information, for example, when user inputs text information in Text Entry, although should The character string of preset length is contained in text information, and the character string meets default replacement logic, but due to the mistake of user Operation or user want change text information, cursor are moved in text information from the end of text information other any Position, so that the character string of the preset length before current cursor in Text Entry does not meet default replacement logic, it should Method does not execute default replacement logic and is not replaced operation to the preset length character string in text information, therefore, should Method can have not enough time to modification and just replace to text information to avoid also needing to modify to text information due to user The maloperation changed.
The text handling method that the embodiment of the present disclosure provides first obtains the text information in Text Entry, however, it is determined that institute The character string for stating the preset length before being located at the cursor in the Text Entry in text information meets default replacement logic, The character string of the preset length is then substituted for and is preset matched random text information in random writing system.The disclosure is real Example is applied by obtaining the text information in Text Entry, is located in the Text Entry in the text information to judge Cursor before the character string of preset length whether meet default replacement logic, if the character string of the preset length meet it is pre- If replacing logic, then executes the default replacement logic and the character string of the preset length is substituted for and is preset random text Matched random text information in system, rapidly realize test data input, and test data relative to be manually entered survey It is more true to try data, and then improves test effect.
In order to realize the default length before the cursor for how determining and being located in the Text Entry in the text information The character string of degree meets default replacement logic, and in one embodiment of the present disclosure, another embodiment of the disclosure provides text Processing method flow diagram, for the embodiment of the present disclosure on the basis of Fig. 1 embodiment, the embodiment of the present disclosure is in step S101 Determine that the character string of preset length in the text information meets default replacement logic and is described in detail.
The character string of preset length meets default replacement logic in the determination text information, comprising: when described pre- If the character string of length includes configurable wake-up symbol and configurable keyword, the character string symbol of the preset length is determined Close default replacement logic.
As can be seen from the above description, the embodiment of the present disclosure is before executing default replacement logic i.e. by the word of the preset length Symbol string is substituted for and presets in random writing system before matched random text information, it is first determined position in the text information The character string of preset length before the cursor in the Text Entry meets default replacement logic i.e. by the default length The character string of degree is substituted for and is preset in random writing system before matched random text information, and this article treatment method is also wrapped It includes: determining that the character string of preset length in the text information meets default replacement logic.
The default length being located at before the cursor in the Text Entry during specific implementation, in the text information The character string of degree needs while meeting containing wake-up symbol and keyword, wherein wakes up symbol and keyword can be according to user's needs Configurableization is carried out, for example, in document input frame (i.e. Text Entry), with two greater-than signs (> >) beginning, and inputs pass Key word or keyword, test macro or terminal device or server can replace corresponding text automatically, for compatible Chinese Input, two right punctuation marks used to enclose the title (" ") are also regarded as legal beginning, therefore, developer can customized wake-ups accord with, can as match The wake-up symbol configuration set (is an open system, can access arbitrary random text and generate mould presetting random writing system Block) in, meanwhile, developer can register new keyword and function in test macro or terminal device or server, with It realizes insertion or replaces other types of data, it can in the extension that is basically carried out for the code packet that this method is realized, be added New keyword and logic realize code.
In practical applications, the preset length before the cursor in the Text Entry is located in the text information Character string meets default wake-up and accords with rule+predetermined keyword rule, i.e., the keyword that configurable wake-up is accorded with+be can configure then is said The character string of preset length before being located at the cursor in the Text Entry in the bright text information meets default replacement Logic.Default replacement logic can be a kind of replacement text logic, can get and preset random text system according to keyword Matched random text information in system, carries out corresponding character replacement.Wherein, presetting and waking up symbol rule can be two continuous Additional character, such as > > or " " etc., preset keyword rule can be comprising uuid (Universally Unique Identifier), name, email The rule of the keywords such as (mail), text, picture, head portrait, for example, uuid, name, email, timestamp, line, Paragraph, pic, avatar etc., then the character string for meeting the preset length of default replacement logic can be > > uuid, > > name,>>email,>>timestamp,>>line,>>paragraph,>>pic,>>avatar.Therefore, when the text envelope The character string of preset length before being located at the cursor in the Text Entry in breath includes configurable wake-up symbol and can match When the keyword set, determine that the character string of the preset length meets default replacement logic, and then by the word of the preset length Symbol string is substituted for and presets matched random text information in random writing system, is replaced by text, realizes test data Rapidly input, and guarantee the authenticity of test data and the validity of replacement, and then ensure that test effect.
It is located at the character string of the preset length before the cursor in the Text Entry in determining the text information What after meeting default replacement logic, start to execute the default operation for replacing logic in a under the conditions of to determine, with reference to Fig. 2 It is shown, in one embodiment of the present disclosure, the condition for starting to execute default replacement logical operation is described in detail.
Fig. 2 is the text handling method flow diagram that another embodiment of the disclosure provides, and the embodiment of the present disclosure is above-mentioned On the basis of embodiment, for example, step S102 is described in detail in the embodiment of the present disclosure on the basis of Fig. 1 embodiment. It is described if it is determined that the character string of preset length meets default replacement logic in the text information, then by the word of the preset length Symbol string is substituted for and presets matched random text information in random writing system, comprising:
S201, if it is determined that the character string of preset length meets default replacement logic in the text information, then start timing.
In the embodiment of the present disclosure, in order to avoid the ineffectivity or raising user experience of replacement, the text envelope is being determined When the character string of preset length before being located at the cursor in the Text Entry in breath meets default replacement logic, it is also necessary to Determine whether user wants replacement text and devise time-constrain in the embodiments of the present disclosure.Specifically, however, it is determined that the text The character string of preset length before being located at the cursor in the Text Entry in this information meets default replacement logic, then touches Hair starts the event of clocking capability, starts timing.
S202, reach preset time when timing time, then by the character string of the preset length be substituted for it is default random Matched random text information in writing system.
In the embodiment of the present disclosure, after starting timing, if monitoring text not new in Text Entry within a preset time This information input and text information is not also modified, it is determined that user may want to text and replace automatically.Wherein, when presetting Between can be 300ms.
In the embodiments of the present disclosure, whether there is update by time-constrain and detection text information, to determine whether Automatic replacement is executed, reduces the maloperation replaced automatically, improves user experience.
It is located at the character string of the preset length before the cursor in the Text Entry in determining the text information After meeting default replacement logic, in order to realize the operating process for executing logic of propositions replacement, refering to what is shown in Fig. 3, in the disclosure One embodiment in, to execute logic of propositions replacement operating process be described in detail.
Fig. 3 is the flow diagram for the text handling method that the another embodiment of the disclosure provides, and the embodiment of the present disclosure is upper On the basis of stating embodiment, for example, on the basis of Fig. 2 embodiment, in conjunction with shown in Fig. 4 a, 4b, 4c, 4d, 4e, 4f, 4g, 4h The schematic diagram (schematic diagram of interface display) of text handling method, the embodiment of the present disclosure in step S102 by the preset length Character string be substituted for and preset matched random text information in random writing system and be described in detail.It is described will be described The character string of preset length is substituted for and presets matched random text information in random writing system, comprising:
S301, it is accorded with by the configurable wake-up, the event for presetting random writing system is called in triggering.
In the embodiment of the present disclosure, configurable wake-up meets default wake up and accords with rule, such as two continuous special Different symbol such as with two greater-than signs (> >) beginning, or is compatible input in Chinese, and with two right punctuation marks used to enclose the title (" ") beginning, this can match The wake-up symbol set, which can trigger, calls the event for presetting random writing system, it can call for support it is configurable with The default random writing system of machine text generation module, configurable random text generation module, which can be used as, presets random text The plug-in unit of system can constantly configure new plug-in unit and realize different replacement functions according to testing requirement, i.e., described default random Writing system is for supporting configurable random text generation module.
Wherein, in a kind of possible design, the configurable keyword includes at least one of following: general unique knowledge Other code, name, timestamp, head portrait, image, random text;The configurable random text generation module can for it is general only One identification code generation module, name generation module, timestamp generation module, head portrait generation module, image generation module, Yi Jisui Any one of machine text generation module;The unique identifier generation module is generated by Open-Source Tools unique identifier 's;The name generation module is generated by default English surname and default name database random fit;The time Stamp generation module is generated by the date object for formula scripting language of literal translating;The head portrait generation module is default by first What online resource generated;Described image generation module is generated by the second default online resource;The random text module It is that random selection and combination producing are passed through according to general automatic occupy-place text.
Therefore, random text generation module is can to configure to generate by preset or newly created functional module, wherein Random writing system is an open system, can access arbitrary random text generation module.Random writing system can prop up That holds has:
Uuid (Universally Unique Identifier): Open-Source Tools uuid (https: //www.npmjs.com/package/ is utilized Uuid it) generates.
Name: common English surname and the random assembled generation of name database (source is wikipedia) are utilized.
Timestamp: it is generated using js (JavaScript, formula scripting language of literal translating) primary Date object.
Head portrait: it is generated using free online resource pravatar.cc.
Image: it is generated using free online resource picsum.photos.
Random text: pass through random selection and combination producing using general automatic occupy-place text.
Wherein, general occupy-place text is the occupy-place text of industry universal, is just used in press since 1500:
"Lorem ipsum dolor sit amet,consectetur adipiscing elit liqi,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident,sunt in culpa qui officia deserunt mollit anim id est laborum."
S302, the random text corresponding with the configurable keyword is obtained in random writing system from described preset This information.
In the embodiment of the present disclosure, interchangeable random text information is obtained in random writing system from described preset.For example, As shown in fig. 4 a, if that include in the character string of the preset length is > > uuid, according to keyword uuid (general unique knowledge Other code), random Universally Unique Identifier is generated by Universally Unique Identifier generation module and is matched with keyword uuid, from institute Stating and presetting acquisition random text information corresponding with keyword uuid in random writing system is random general unique identification Code;As shown in Figure 4 b, if that include in the character string of the preset length is > > name, according to keyword name (name or Name), random name is generated by name generation module and is matched with keyword name, i.e., presets random writing system from described It is middle that obtain corresponding with keyword name random text information be random name;As illustrated in fig. 4 c, if the preset length Character string in that include is > > email, then according to keyword email (mailbox), generated by mailbox generation module random Email address is matched with keyword email, i.e., from it is described preset in random writing system obtain it is corresponding with keyword email with Machine text information is random email address;As shown in figure 4d, if include in the character string of the preset length be > > Timestamp, then according to keyword timestamp (timestamp), by timestamp generation module generate random timestamp with Keyword timestamp matching, i.e., from it is described preset in random writing system obtain it is corresponding with keyword timestamp at random Text information is random timestamp;As shown in fig 4e, if that include in the character string of the preset length is > > line, According to keyword line (short text), random short text is generated by random text generation module and is matched with keyword line, Preset that corresponding with keyword line random text information is obtained in random writing system is random short text from described; As shown in fig. 4f, if that include in the character string of the preset length is > > paragraph, according to keyword paragraph (long text) generates random long text by random text generation module and matches with keyword paragraph, i.e., from described pre- If obtaining random text information corresponding with keyword paragraph in random writing system is random long text;Such as figure It is raw by image according to keyword pic (image) if that include in the character string of the preset length is > > pic shown in 4g Random image is generated at module to match with keyword pic, i.e., obtains and keyword pic from described preset in random writing system Corresponding random text information be image link (free online resource picsum.photos), linked by image, obtain with The image of machine;As shown in figure 4h, if that include in the character string of the preset length is > > avatar, according to keyword Avatar (head portrait) generates random image by head portrait generation module and matches with keyword avatar, i.e., from it is described it is default with It is that head portrait links (free online resource that random text information corresponding with keyword avatar is obtained in machine writing system Pravatar.cc), linked by head portrait, obtain random head portrait.Wherein, what above-mentioned keyword all can be random.
S303, the character string that the random text information is replaced to the preset length are shown in the Text Entry Show the random text information.
In the embodiment of the present disclosure, at the text in conjunction with shown in step S302 and Fig. 4 a, 4b, 4c, 4d, 4e, 4f, 4g, 4h The schematic diagram of reason shows the random text information replaced in the Text Entry, so that user can be intuitive See test data in ground, wherein the display of image and head portrait is the preview picture after the link of user's electrode, and does not appear in In the Text Entry, being shown in Text Entry is image link and head portrait link.
After having executed text replacement, the test of other data of next round is carried out convenient for user, needs to terminate this text The replacement operation of this information, the embodiment of the present disclosure on the basis of the above embodiments, for example, on the basis of Fig. 2 embodiment, knot The schematic diagram of text-processing shown in Fig. 4 a, 4b, 4c, 4d, 4e, 4f, 4g, 4h is closed, the embodiment of the present disclosure is to the text-processing Method is described in detail.It is substituted in the character string by the preset length and matches with presetting in random writing system Random text information after, the method also includes: the cursor is moved to the text end of the random text information, To indicate that replacement operation is completed.
In the embodiment of the present disclosure, it is substituted for and presets in random writing system in the character string by the preset length After matched random text information, the text end of the random text information can be moved the cursor to, and then trigger knot Therefore the cursor is moved to the text end of the random text information by the event of beam replacement operation, can indicate to replace Operation is completed.
In practical applications, shown in Figure 5, the embodiment of the present disclosure provides a kind of text processing system, including terminal And server, wherein the terminal can be mobile terminal (such as mobile phone 502), fixed terminal (such as computer 501), electronics The friendship that test data rapidly inputs and then realizes text replacement may be implemented in equipment or test macro end, terminal and server 503 Mutual process, wherein if terminal is mobile phone 502, the wireless network connection of mobile phone 502 Yu server 503 is realized, if terminal is hand Machine 602 then realizes the wirelessly or non-wirelessly network connection of computer 501 Yu server 503.Specifically, user passes through user terminal or use Family inputs in the Text Entry configurable directly on the test interface of terminal device, electronic equipment or test macro end Or customized wake-up symbol (can be defaulted as > >), user inputs keyword after waking up symbol, and (keyword can be can to match It is setting or customized), such as (uuid), actuating station (server) obtains user in text by real time monitoring Text Entry The text information inputted in this input frame, if current cursor of the text information of user's input in the Text Entry it Comprising meeting wake-up symbol rule+keyword rule character in preceding 30 brief notes (length of 30 brief notes is preset length) When string, 300ms is waited, if actuating station is not detected the text information and updates, executes default replacement logic i.e. according to character Keyword in string matches random text information from presetting in random writing system, and then the character string of the preset length is replaced It changes the random text information into, and moves the cursor to replaced text (random text information) end, to indicate to replace It completes, user can continue to input other contents.This method rapidly realizes the input of test data, while avoiding the mistake of replacement Operation, and test data is more true relative to test data is manually entered, and then improves test effect.
Corresponding to the text handling method of embodiment disclosed above, Fig. 6 is the text-processing dress that the embodiment of the present disclosure provides The structural block diagram set.For ease of description, part relevant to the embodiment of the present disclosure is illustrated only.Referring to Fig. 6, described device packet It includes: obtaining module 601 and replacement logic execution module 602;The module 601 that obtains is used to obtain the text in Text Entry Information;The replacement logic execution module 602, the character string for the preset length in determining the text information meets default When replacing logic, the character string of the preset length is substituted for and is preset matched random text in random writing system and is believed Breath, wherein the character string of the preset length is the character string before the cursor in the Text Entry.
In one embodiment of the present disclosure, the embodiment of the present disclosure on the basis of the above embodiments, for example, Fig. 6 reality On the basis of applying example, the replacement logic execution module 602 is described in detail in the embodiment of the present disclosure.The replacement logic Execution module 602, is specifically used for: when the character string of the preset length includes configurable wake-up symbol and configurable keyword When, determine that the character string of the preset length meets default replacement logic.
Alternatively, the text processing apparatus further include: determining module;The determining module is used for by the preset length Character string be substituted for and preset in random writing system before matched random text information, when the character of the preset length When string includes configurable wake-up symbol and configurable keyword, determine that the character string of the preset length meets default replacement and patrols Volume.
In one embodiment of the present disclosure, the embodiment of the present disclosure on the basis of the above embodiments, for example, Fig. 6 reality On the basis of applying example, the replacement logic execution module 602 is specifically used for: the preset length in determining the text information When character string meets default replacement logic, start timing;When timing time reaches preset time, then by the word of the preset length Symbol string is substituted for and presets matched random text information in random writing system.
In one embodiment of the present disclosure, the embodiment of the present disclosure on the basis of the above embodiments, the replacement logic Execution module 602, also particularly useful for: it is accorded with by the configurable wake-up, triggering, which is called, described presets random writing system Event, it is described to preset random writing system for supporting configurable random text generation module;Random text is preset from described The random text information corresponding with the configurable keyword is obtained in system;The random text information is replaced into institute The character string for stating preset length shows the random text information in the Text Entry.
In one embodiment of the present disclosure, shown in Figure 7 in order to terminate replacement operation, Fig. 7 is the another reality of the disclosure The structural block diagram of the text processing apparatus of example offer is provided.The embodiment of the present disclosure on the basis of the above embodiments, for example, in Fig. 6 Or on the basis of the Installation practice of any disclosure, the embodiment of the present disclosure has carried out specifically the text processing apparatus It is bright.Described device further include: cursor mobile module 603;The cursor mobile module, for described by the preset length Character string is substituted for and is preset in random writing system after matched random text information, by the cursor be moved to it is described with The text end of machine text information, to indicate that replacement operation is completed.
In one embodiment of the present disclosure, the embodiment of the present disclosure on the basis of the above embodiments, to the keyword And the configurable random text generation module is explained explanation.The keyword is configurable keyword, packet It includes at least one of following: Universally Unique Identifier, name, timestamp, head portrait, image, random text;It is described configurable random Text generation module is Universally Unique Identifier generation module, name generation module, timestamp generation module, head portrait generation mould Any one of block, image generation module and random text generation module;Wherein, the unique identifier generation module is It is generated by Open-Source Tools unique identifier;The name generation module is by default English surname and default name data What library random fit generated;The timestamp generation module is generated by the date object for formula scripting language of literal translating;It is described Head portrait generation module is generated by the first default online resource;Described image generation module is by the second default online money What source generated;The random text module is to pass through random selection and combination producing according to general automatic occupy-place text.
The device that the embodiment of the present disclosure provides, can be used for executing the technical solution of above method embodiment, realization principle Similar with technical effect, details are not described herein again for the embodiment of the present disclosure.
With reference to Fig. 8, it illustrates the structural schematic diagrams for the electronic equipment 800 for being suitable for being used to realize the embodiment of the present disclosure, should Electronic equipment 800 can be terminal device or server.Wherein, terminal device can include but is not limited to such as mobile phone, Laptop, personal digital assistant (Personal Digital Assistant, abbreviation PDA), is put down at digit broadcasting receiver Plate computer (Portable Android Device, abbreviation PAD), portable media player (Portable Media Player, abbreviation PMP), the mobile terminal and such as number TV, desk-top meter of car-mounted terminal (such as vehicle mounted guidance terminal) etc. The fixed terminal of calculation machine etc..Electronic equipment shown in Fig. 8 is only an example, should not function to the embodiment of the present disclosure and Use scope brings any restrictions.
As shown in figure 8, electronic equipment 800 may include processing unit (such as central processing unit, graphics processor etc.) 801, it can be according to the program being stored in read-only memory (Read Only Memory, abbreviation ROM) 802 or from storage Program that device 808 is loaded into random access storage device (Random Access Memory, abbreviation RAM) 803 and execute each Kind movement appropriate and processing.In RAM 803, also it is stored with electronic equipment 800 and operates required various programs and data.Place Reason device 801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to Bus 804.
In general, following device can connect to I/O interface 805: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 806 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (Liquid Crystal Display, abbreviation LCD), loudspeaker, vibrator etc. output device 807;Storage device including such as tape, hard disk etc. 808;And communication device 809.Communication device 809 can permit electronic equipment 800 and wirelessly or non-wirelessly be led to other equipment Letter is to exchange data.Although Fig. 8 shows the electronic equipment 800 with various devices, it should be understood that being not required for reality Apply or have all devices shown.It can alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 809, or from storage device 808 It is mounted, or is mounted from ROM802.When the computer program is executed by processing unit 801, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment executes method shown in above-described embodiment.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (Local Area Network, abbreviation LAN) or wide area network (Wide Area Network, abbreviation WAN)-be connected to subscriber computer, or Person, it may be connected to outer computer (such as being connected using ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the disclosure, rather than its limitations;To the greatest extent Pipe is described in detail the disclosure referring to foregoing 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, each embodiment technology of the disclosure that it does not separate the essence of the corresponding technical solution The range of scheme.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the disclosure, rather than its limitations;To the greatest extent Pipe is described in detail the disclosure referring to foregoing 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, each embodiment technology of the disclosure that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (14)

1. a kind of text handling method characterized by comprising
Obtain the text information in Text Entry;
If it is determined that the character string of preset length meets default replacement logic in the text information, then by the word of the preset length Symbol string is substituted for and presets matched random text information in random writing system, wherein the character string of the preset length is Character string before the cursor in the Text Entry.
2. the method according to claim 1, wherein in the determination text information preset length character String meets default replacement logic, comprising:
When the character string of the preset length includes configurable wake-up symbol and configurable keyword, the default length is determined The character string of degree meets default replacement logic.
3. according to the method described in claim 2, it is characterized in that, it is described if it is determined that in the text information preset length word Symbol string meets default replacement logic, then the character string of the preset length is substituted for and is preset and is matched in random writing system Random text information, comprising:
If it is determined that the character string of preset length meets default replacement logic in the text information, then start timing;
When timing time reaches preset time and determines that the text information does not update, then the character string of the preset length is replaced Change and preset matched random text information in random writing system into.
4. according to the method described in claim 3, it is characterized in that, the character string by the preset length be substituted for in advance If matched random text information in random writing system, comprising:
By the configurable wake-up symbol, the event for presetting random writing system is called in triggering;
The random text information corresponding with the configurable keyword is obtained in random writing system from described preset;
The character string that the random text information is replaced to the preset length is shown described random in the Text Entry Text information.
5. according to the method described in claim 3, it is characterized in that, the character string by the preset length be substituted for It presets in random writing system after matched random text information, the method also includes:
The cursor is moved to the text end of the random text information, to indicate that replacement operation is completed.
6. according to the described in any item methods of claim 2-5, which is characterized in that the configurable keyword include it is following extremely One item missing: Universally Unique Identifier, name, timestamp, head portrait, image, random text.
7. a kind of text processing apparatus characterized by comprising
Module is obtained, for obtaining the text information in Text Entry;
Logic execution module is replaced, the character string for the preset length in determining the text information meets default replacement logic When, the character string of the preset length is substituted for and is preset matched random text information in random writing system, wherein institute The character string for stating preset length be cursor in the Text Entry before character string.
8. device according to claim 7, which is characterized in that the replacement logic execution module is specifically used for:
When the character string of the preset length includes configurable wake-up symbol and configurable keyword, the default length is determined The character string of degree meets default replacement logic.
9. device according to claim 8, which is characterized in that the replacement logic execution module, also particularly useful for:
When the character string of preset length meets default replacement logic in determining the text information, start timing;
When timing time reaches preset time, then the character string of the preset length is substituted for and is preset in random writing system Matched random text information.
10. device according to claim 9, which is characterized in that the replacement logic execution module, also particularly useful for:
By the configurable wake-up symbol, the event for presetting random writing system is called in triggering;
The random text information corresponding with the configurable keyword is obtained in random writing system from described preset;
The character string that the random text information is replaced to the preset length is shown described random in the Text Entry Text information.
11. device according to claim 9, which is characterized in that described device further include: cursor mobile module;
The cursor mobile module, for being substituted for and presetting random writing system in the character string by the preset length In after matched random text information, the cursor is moved to the text end of the random text information, to indicate to replace Operation is changed to complete.
12. according to the described in any item devices of claim 8-11, which is characterized in that the configurable keyword includes following At least one of: Universally Unique Identifier, name, timestamp, head portrait, image, random text.
13. a kind of electronic equipment characterized by comprising at least one processor and memory;
The memory stores computer executed instructions;
At least one described processor executes the computer executed instructions of the memory storage, so that at least one described processing Device executes such as text handling method as claimed in any one of claims 1 to 6.
14. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium It executes instruction, when processor executes the computer executed instructions, realizes such as text as claimed in any one of claims 1 to 6 Processing method.
CN201910724673.4A 2019-08-07 2019-08-07 Text handling method, device, equipment and storage medium Pending CN110427328A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910724673.4A CN110427328A (en) 2019-08-07 2019-08-07 Text handling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910724673.4A CN110427328A (en) 2019-08-07 2019-08-07 Text handling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110427328A true CN110427328A (en) 2019-11-08

Family

ID=68412947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910724673.4A Pending CN110427328A (en) 2019-08-07 2019-08-07 Text handling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110427328A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688359A (en) * 2020-05-18 2021-11-23 北京京东尚科信息技术有限公司 Processing method and device for program code, computing equipment and medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662575A (en) * 2012-03-27 2012-09-12 上海量明科技发展有限公司 Method for modifying text, client and system
JP2013196269A (en) * 2012-03-19 2013-09-30 Hitachi Systems Ltd Test data generation system and test data generation device
CN103473003A (en) * 2013-09-12 2013-12-25 天津三星通信技术研究有限公司 Character input error correction method and device
CN103853650A (en) * 2012-11-28 2014-06-11 西门子公司 Test case generating method and device for fuzz testing
CN105224666A (en) * 2015-10-08 2016-01-06 广东欧珀移动通信有限公司 A kind of input method, device and terminal
CN105786295A (en) * 2014-12-19 2016-07-20 阿里巴巴集团控股有限公司 Character input method and device
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN108388545A (en) * 2018-01-26 2018-08-10 浪潮软件集团有限公司 Method and tool for generating test data of text input box
CN108647355A (en) * 2018-05-16 2018-10-12 平安普惠企业管理有限公司 Methods of exhibiting, device, equipment and the storage medium of test case
CN108664574A (en) * 2018-04-27 2018-10-16 平安科技(深圳)有限公司 Input method, terminal device and the medium of information
CN109408113A (en) * 2018-09-03 2019-03-01 平安普惠企业管理有限公司 A kind of code text processing method, system and terminal device
CN109656384A (en) * 2018-12-24 2019-04-19 北京字节跳动网络技术有限公司 Character string input method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013196269A (en) * 2012-03-19 2013-09-30 Hitachi Systems Ltd Test data generation system and test data generation device
CN102662575A (en) * 2012-03-27 2012-09-12 上海量明科技发展有限公司 Method for modifying text, client and system
CN103853650A (en) * 2012-11-28 2014-06-11 西门子公司 Test case generating method and device for fuzz testing
CN103473003A (en) * 2013-09-12 2013-12-25 天津三星通信技术研究有限公司 Character input error correction method and device
CN105786295A (en) * 2014-12-19 2016-07-20 阿里巴巴集团控股有限公司 Character input method and device
CN105224666A (en) * 2015-10-08 2016-01-06 广东欧珀移动通信有限公司 A kind of input method, device and terminal
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device
CN108388545A (en) * 2018-01-26 2018-08-10 浪潮软件集团有限公司 Method and tool for generating test data of text input box
CN108664574A (en) * 2018-04-27 2018-10-16 平安科技(深圳)有限公司 Input method, terminal device and the medium of information
CN108647355A (en) * 2018-05-16 2018-10-12 平安普惠企业管理有限公司 Methods of exhibiting, device, equipment and the storage medium of test case
CN109408113A (en) * 2018-09-03 2019-03-01 平安普惠企业管理有限公司 A kind of code text processing method, system and terminal device
CN109656384A (en) * 2018-12-24 2019-04-19 北京字节跳动网络技术有限公司 Character string input method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
焦龙龙等: "变异策略动态构建的模糊测试数据生成方法", 《北京理工大学学报》 *
焦龙龙等: "变异策略动态构建的模糊测试数据生成方法", 《北京理工大学学报》, no. 05, 15 May 2019 (2019-05-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688359A (en) * 2020-05-18 2021-11-23 北京京东尚科信息技术有限公司 Processing method and device for program code, computing equipment and medium

Similar Documents

Publication Publication Date Title
US10095380B2 (en) Method for providing information based on contents and electronic device thereof
EP3206110B1 (en) Method of providing handwriting style correction function and electronic device adapted thereto
CN109725901A (en) Development approach, device, equipment and the computer storage medium of front-end code
CN109710870A (en) Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN103702297A (en) Short message enhancement method, device and system
US20180181999A1 (en) Electronic device and method for displaying web page using the same
CN108829311A (en) A kind of method and apparatus based on Widget display data
CN111666776A (en) Document translation method and device, storage medium and electronic equipment
CN111368180A (en) Page display method and device and electronic equipment
CN110471738A (en) Method for switching theme, device, electronic equipment and the storage medium of application program
CN109446199A (en) Cell data processing method and device
US10540415B2 (en) Apparatus and method for managing history information in an electronic device
CN111008047A (en) Page element conflict processing method and device and electronic equipment
CN110489106A (en) A kind of generation method, device, medium and the electronic equipment of project initial code
CN110427328A (en) Text handling method, device, equipment and storage medium
CN103309677B (en) Built-in resource management, device and terminal
CN110148024B (en) Method and device for providing comment input mode
CN109491687A (en) A kind of hot update method, device, terminal and the readable medium of application software
EP3594823B1 (en) Information display method, terminal and server
US20160196030A1 (en) Method and electronic device for displaying electronic document
CN109683726A (en) Characters input method, device, electronic equipment and storage medium
CN110413367A (en) Task creation method, apparatus, storage medium and electronic equipment
CN110442419A (en) The quick interface arrangement method and device of Android application
CN114580361A (en) Document processing method and device, electronic equipment and storage medium
CN109657073A (en) Method and apparatus for generating information

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