CN107943782A - A kind of character processing method and terminal - Google Patents

A kind of character processing method and terminal Download PDF

Info

Publication number
CN107943782A
CN107943782A CN201710945419.8A CN201710945419A CN107943782A CN 107943782 A CN107943782 A CN 107943782A CN 201710945419 A CN201710945419 A CN 201710945419A CN 107943782 A CN107943782 A CN 107943782A
Authority
CN
China
Prior art keywords
character
node
sensitive
webpage
terminal
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.)
Withdrawn
Application number
CN201710945419.8A
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.)
Shenzhen Jinli Communication Equipment Co Ltd
Original Assignee
Shenzhen Jinli Communication Equipment 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 Shenzhen Jinli Communication Equipment Co Ltd filed Critical Shenzhen Jinli Communication Equipment Co Ltd
Priority to CN201710945419.8A priority Critical patent/CN107943782A/en
Publication of CN107943782A publication Critical patent/CN107943782A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • 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/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a kind of character processing method and terminal, wherein method includes:Detect the content node of webpage in destination document;The text node in the content node is extracted, and the character in the text node is matched with the preset characters in preset characters group;Sensitive character in the text node is replaced with into designated character, the sensitivity character is the character to match in the text node with the preset characters, can filter out sensitive character comprehensively.

Description

A kind of character processing method and terminal
Technical field
The present invention relates to field of computer technology, more particularly to a kind of character processing method and terminal.
Background technology
With the continuous development of computer technology, people obtain the method for information and the side that approach is also more and more, common Method can carry out web page browsing by terminal (such as mobile phone, tablet computer, wearable device etc.), to search desired letter Breath.
When people browse webpage by terminal, usually occur that some sensitive characters are (such as filthy, reaction on webpage Word etc.), these sensitive characters can not only influence the legitimacy of webpage, also destroy in the environment of network information fast propagation The rigor of webpage in itself.At present, number of site does not deal with these sensitive characters, number of site can be by backstage at Some sensitive characters are managed, when processing sensitive character, the purpose of the sensitive character of filtering can be realized by back-end data.
However, it is confined to sensitive words of the processing by back-end data generation above by the mode of background process sensitivity character Symbol.
The content of the invention
The embodiment of the present invention provides a kind of character processing method and terminal, can comprehensively filter the net being shown in terminal Sensitive character in page, improves the legitimacy and rigor of webpage.
In a first aspect, an embodiment of the present invention provides a kind of character processing method, this method includes:
Detect the content node of webpage in the destination document;
The text node in the content node is extracted, and by the character in the text node and preset characters group Preset characters are matched, and the character in the text node is included at least by the character or non-post number of units of back-end data generation According to the character of generation;
Sensitive character in the text node is replaced with into designated character, the sensitivity character is in the text node The character to match with the preset characters.
Second aspect, an embodiment of the present invention provides a kind of terminal, which includes being used to perform above-mentioned first aspect institute State the unit of method.
The third aspect, an embodiment of the present invention provides a kind of browser, which includes being used to perform above-mentioned first party The unit of face the method.
Fourth aspect, an embodiment of the present invention provides another terminal, including processor, input equipment, output equipment and Memory, the processor, input equipment, output equipment and memory are connected with each other, wherein, the memory is used to store branch The application code that terminal performs the above method is held, the processor is arranged to the method for performing above-mentioned first aspect.
5th aspect, an embodiment of the present invention provides a kind of computer-readable recording medium, the computer-readable storage medium Computer program is stored with, the computer program includes programmed instruction, and described program instruction makes institute when being executed by a processor State the method that processor performs above-mentioned first aspect.
The embodiment of the present invention is by detecting the content node of webpage in destination document, and by the text node in content node In character matched with the preset characters in preset characters group, the sensitive character in text node is then replaced with into finger Determine character, the sensitive character in webpage can be filtered out comprehensively, improve the legitimacy and rigor of webpage.
Brief description of the drawings
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the present invention, general for this area For logical technical staff, without creative efforts, other attached drawings can also be obtained according to these attached drawings.
Fig. 1 is a kind of schematic flow diagram of character processing method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow diagram for character processing method that another embodiment of the present invention provides;
Fig. 3 is a kind of schematic block diagram of terminal provided in an embodiment of the present invention;
Fig. 4 is the schematic block diagram of another terminal provided in an embodiment of the present invention;
Fig. 5 is the schematic block diagram of another terminal provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is part of the embodiment of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without making creative work Example, belongs to the scope of protection of the invention.
It should be appreciated that ought use in this specification and in the appended claims, term " comprising " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but it is not precluded from one or more of the other feature, whole Body, step, operation, element, component and/or its presence or addition for gathering.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combinations and all possible combinations of one or more of the associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determining " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In the specific implementation, the terminal described in the embodiment of the present invention is including but not limited to such as with touch sensitive surface The mobile phone, laptop computer or tablet PC of (for example, touch-screen display and/or touch pad) etc it is other just Portable device.It is to be further understood that in certain embodiments, the equipment is not portable communication device, but with tactile Touch the desktop computer of sensing surface (for example, touch-screen display and/or touch pad).
In discussion below, the terminal including display and touch sensitive surface is described.It is, however, to be understood that It is that terminal can include one or more of the other physical user-interface device of such as physical keyboard, mouse and/or control-rod.
Terminal supports various application programs, such as one or more of following:Drawing application program, demonstration application journey Sequence, word-processing application, website create application program, disk imprinting application program, spreadsheet applications, game application Program, telephony application, videoconference application, email application, instant messaging applications, exercise Support application program, photo management application program, digital camera application program, digital camera application program, web-browsing application Program, digital music player application and/or video frequency player application program.
The various application programs that can be performed in terminal can use at least one public of such as touch sensitive surface Physical user-interface device.It can adjust and/or change among applications and/or in corresponding application programs and touch sensitive table The corresponding information shown in the one or more functions and terminal in face.In this way, the public physical structure of terminal is (for example, touch Sensing surface) it can support the various application programs with user interface directly perceived and transparent for a user.
At present, for some the sensitive characters with filth, reaction property occurred on webpage, generally use two ways Filtered:One kind be using manually check, then again by terminal-pair check come character updated, with change Fall these and check the character come.However, when netpage page face length is excessive, carrying out inspection to character manually one by one can consume Take substantial amounts of time and manpower, and by terminal against these check come character edited one by one, also can inevitably deposit Omitting or wrong situation about changing, causing to filter the problem of sensitive character is not comprehensive enough, reducing the legitimacy and rigor of webpage.
Another kind is by the way of carrying out automatic fitration sensitivity character using backstage.Data are obtained by backstage for some Sensitive character, can handle some sensitive characters shown by back-end data from the background, reach the mesh of the sensitive character of filtering 's.Generated in itself by webpage however, this mode cannot handle some, or the non-backstage acquisition being illustrated on webpage Sensitive character, equally also results in the problem of sensitive character of filtering is not comprehensive enough, reduces the legitimacy and rigor of webpage
Set forth above in order to solve the problems, such as, an embodiment of the present invention provides a kind of character processing method and device.In order to It is better understood from, first the embodiment of the method for the embodiment of the present invention is described below.
It should be noted that the executive agent of the embodiment of the present invention can be various types of terminals, such as can be intelligence Can mobile phone, tablet computer, wearable device, computer, personal digital assistant (English:Personal Digital Assistant, abbreviation:PDA), mobile internet device (English:Mobile Internet Device, abbreviation:) etc. MID can Carry out the terminal of data processing.
It should also be noted that, the executive agent of the embodiment of the present invention can also be the browser in terminal, such as webpage Browser, client, using etc. can be with the instrument at displayed web page interface.
Referring to Fig. 1, it is a kind of schematic flow diagram of character processing method provided in an embodiment of the present invention, as shown in Figure 1 Character processing method may include:
The content node of webpage in S101, detection destination document.
It should be noted that the destination document can be specifically document fragment, text document etc..
In some feasible embodiments, in the detection destination document before the content node of webpage, also wrap Include:The webpage in browser is obtained, and the webpage is loaded into destination document.
In the specific implementation, terminal can copy to the content node in webpage in destination document, in order to character When being handled, the normal use of webpage in itself is not influenced, avoids the interim card of webpage, the problems such as loading velocity is slow.
In the specific implementation, the terminal detects the content node on webpage first, then the content node on the webpage is answered Make in destination document, which can store all the elements node of webpage.Further, which can pass through Detection destination document can get the content node of the webpage.
In some feasible embodiments, which can also be other of the content node that stores the webpage Document, the invention is not limited in this regard.
It should also be noted that, the webpage can be any type of webpage, for example, webpage for shopping, for browsing The webpage of news.Webpage for searching for information etc., the invention is not limited in this regard.
It should also be noted that, the content node of the webpage can include label node and text node.Wherein, the mark It can also include subtab node and sub- text node in label node.
Optionally, before the content node in the detection destination document, can also include:Obtain the content section in webpage Point;The content node in the webpage is replicated, and the content node of the duplication is added in the destination document, which delays Deposit in the terminal, and be different from the webpage.
In some feasible embodiments, the mode of the content node on terminal detection webpage, can pass through JavaScript code obtains the DOM Document Object Model (Document Object Model, DOM) in webpage, and DOM is used to show The content node of webpage, then, the terminal can copy to the content node of the webpage in DOM in destination document.
Text node in S102, the extraction content node, and by the character and preset characters in the text node Preset characters in group are matched.
Optionally, the text node in the content node, can include the first text node and the second text node.Its In, which can be the text node of itself in the content node, which can be the content Sub- text node in node in label node.
Optionally, which can extract the text node of the content node according to node type.
It should also be noted that, the character in the text node includes at least the character or non-generated by back-end data The character of back-end data generation.
Wherein, the character of back-end data generation, what the data that can refer to be fed back by the backstage of maintenance webpage generated Character, for example, the news content in webpage, site information content in webpage etc., the embodiment of the present invention does not make this any Limitation.
Wherein, the character of non-back-end data generation, can be by illegal channels be superimposed upon character in webpage or The character generated by webpage itself, for example, ad content floated everywhere in Webpage etc., the present invention embodiment is to this It is not intended to be limited in any.
In some feasible embodiments, which can be with the content node in recursive traversal destination document, Ran Houlu The continuous node type for checking the content node.When node type is text node, text node is just extracted.Work as node type For label node when, the terminal can continue to the label node carry out recursive traversal, specifically, the terminal detects the label section Point, if there is text node, it is possible to extract the sub- text node in the destination document, if there is subtab section Point, it is possible to the process of above-mentioned recursive traversal is repeated, untill the text node in the subtab node is extracted.
It should also be noted that, the preset characters group can be that terminal is pre-set, be stored with all illegal types Preset characters.Wherein, the illegal type, can be specifically any one in obscene type, reaction type, type of starting a rumour Or polytype.
In the specific implementation, the terminal carries out the preset characters in the character in text node and preset characters group Match somebody with somebody, can be specifically that the preset characters in the character in text node and preset characters group are subjected to canonical matching, if should Character in text node is identical with some preset characters in preset characters group, it is possible to performs S103 steps.
In some feasible embodiments, if the character in text node and the preset characters in preset characters group Different, which can be retained, alternatively, the terminal can not make it any processing, the present invention is implemented Example is not intended to be limited in any this.
S103, by the sensitive character in the text node replace with designated character.
Wherein, which is the character to match in text node with the preset characters.
It should be noted that if the terminal detects the sensitive character in text node and certain in preset characters group One preset characters is identical, it is possible to determines that the sensitivity character matches with the preset characters.
It should also be noted that, the designated character can be the default character for being used to replace the sensitivity character of terminal.Tool Body, which can be various types of roman characters, such as * ,/,+etc.;Alternatively, the designated character can also be Various prompting characters, such as the character of " sensitive information " printed words, certainly, above-mentioned character are simply illustrated, and non exhaustive, comprising but not It is limited to above-mentioned designated character.
Optionally, the original character in text node is replaced with designated character by this, including:Detect text node In the original character character quantity;When the original character in text node is replaced with designated character, determining should The character quantity of designated character is the character quantity of the original character.
For example, which is *.The terminal can detect the character of the sensitive character in text node first Quantity, if the character quantity is 3, which can replace with designated character by the sensitivity character in text node When, it is possible to the character quantity for determining the designated character is 3, and can be on the position of the sensitivity character, by the sensitive words Symbol replaces with * * *.
Again for example, in minor's using terminal, put the webpage opened in terminal and easily carry instigating property by some The sensitive character of matter is attracted, some sensitive characters can reside in the illegal advertisement in terminal, be filtered by backstage sensitive The mode of character may not be filled into these sensitive characters, but terminal can be by detecting the content section of webpage in destination document Point, and the character in the text node in content node is matched with the preset characters in preset characters group, then should Sensitive character in text node replaces with the mode of designated character, the sensitive character in webpage is filtered out comprehensively, so as to ensure The physical and mental health of minor.
As can be seen that in the embodiment of the present invention, by detecting the content node of webpage in destination document, and by content node In text node in character matched with the preset characters in preset characters group, then by the sensitivity in text node Character replaces with designated character, may not need manual operation, and by terminal by the character in the text node in content node Matched with the preset characters in preset characters group, avoid what the omission of appearance sensitivity character or mistake when webpage is excessive changed Situation, and sensitive character comprehensively, is automatically filtered out, the legitimacy and rigor of webpage are improved, meets the automatic of user Change and intelligent demand.
Referring to Fig. 2, be another embodiment of the present invention provide a kind of character processing method schematic flow diagram, such as Fig. 2 Shown character processing method may include:
The content node of webpage in S201, detection destination document.
Text node in S202, the extraction content node, and by the character and preset characters in the text node Preset characters in group are matched.
S203, by the sensitive character in the text node replace with designated character.
Wherein, the sensitive character is the character to match in the text node with the preset characters.
It should be noted that S201 steps to the S203 steps in the embodiment of the present invention can be according in above method embodiment S101 steps to S103 steps realize that its specific implementation process is referred to the associated description of above method embodiment, herein Repeat no more.
S204, preservation are replaced the text node after processing, and update institute according to the text node of preservation State the content node in destination document.
It should be noted that the text node that sensitive character can be replaced with designated character by the terminal is preserved, together When content node in the destination document is updated according to the text node of the preservation.
In some feasible embodiments, which can replace with designated word in the sensitive character in text node After symbol, first by this be replaced processing after text node preserved, then the preservation text node position Put, the text node that this is replaced to before processing is deleted, while the text node for determining to be replaced after handling is present in The position, it is possible to complete the renewal to the content node of the destination document.
S205, using the content node in the destination document after renewal in the webpage content node carry out more Newly.
In some feasible embodiments, the mode of renewal can be specifically that terminal utilization includes the designated character The destination document in content node, replace the content node in the webpage.
For example, which can be document fragment.The terminal can utilize the document after being updated broken Content node in piece, replaces the content node in webpage.
S206, determine sensitive character types, and the sensitivity character types are the designated character pair for replacing the sensitive character The character types answered.
Wherein, which includes the preset characters of at least two character types, character types and designated character Color correspond.
In some feasible embodiments, which can be pre- by this according to the word classification of preset characters If character is divided into different character types, each character types are distinguished with different character colors.
For example, which can be divided into two kinds of character types, respectively obscene type and type of starting a rumour, excessive The preset characters of dirty type can be indicated with red, and the preset characters for type of starting a rumour can be indicated with green.Certainly, Aforesaid way is simply illustrated, and non exhaustive, including but not limited to above-mentioned optional mode.
Wherein, which is the corresponding character types of designated character for replacing the sensitivity character.
Wherein, the sensitivity character types, can be any of obscene type, reaction type, type of starting a rumour, adline etc. One type.Also, the sensitivity character types can be identical with the character types for the designated character for replacing the sensitivity character, also It is to say, the character types of the designated character, that is, the character types of the sensitivity character.
S207, by the color for the designated character for replacing the sensitive character be arranged to corresponding with the sensitive character types The color of designated character.
It should be noted that the designated character of the replacement sensitivity character, can be on the position of the sensitivity character, incite somebody to action The character that the sensitivity character is replaced, specifically, the designated character can be Roman character, Arabic numerals, English symbol Etc. the character of type, the embodiment of the present invention is not restricted this.
It should also be noted that, the color of designated character corresponding with the sensitivity character types, can be red, green, The color corresponding with the sensitivity character types such as blueness.For example, the sensitivity character types are obscene type, then should be with the sensitivity The color of the corresponding designated character of character types can be red.Certainly, aforesaid way is simply illustrated, and non exhaustive, comprising but It is not limited to above-mentioned optional mode.
In the specific implementation, the terminal determines the color of designated character corresponding with the sensitivity character types, Ran Houzai first The color for the designated character that substituted for the sensitivity character is arranged to the color that the terminal determines.
For example, which can determine that the sensitivity character types are obscene type first, then with the sensitivity character The color of the corresponding designated character of type can be red, and then the terminal will substituted for the face of the designated character of the sensitivity character Color is arranged to red.
It should be noted that the terminal distinguishes the designated character with character color according to character types, Ke Yifang Just the sensitive character that user knows to replace is which type of character.
In some feasible embodiments, which can also will replace the background colour of the designated character of the sensitivity character It is arranged to the background colour of designated character corresponding with the sensitivity character types.
Wherein, which can refer to the color that the character background when designated character is shown in webpage is presented.
For example, which can determine that the sensitivity character types are obscene type first, then with the sensitivity character The background colour of the corresponding designated character of type can be yellow, and then the terminal will substituted for the designated character of the sensitivity character Background colour is arranged to yellow.
Optionally, which includes the preset characters of at least two character types, character types and designated word Symbol corresponds, and replaces the preset characters that the corresponding character types of designated character of the sensitivity character and the sensitivity character match Corresponding character types are identical.
It should be noted that there can be the preset characters of at least two character types in the preset characters group.For example, should Character types can be at least two in obscene type, reaction type, adline, type of starting a rumour, each character types pair Answer different preset characters.
It should also be noted that, according to the difference of character types, the designated character for replacing the sensitivity character is also different.Example Such as, when which is obscene type, designated character corresponding with the salaciousness type can be the character of " * " form;The word When symbol type is reaction type, designated character corresponding with the reaction type can be the character of "/" form.Certainly, above-mentioned side Formula is simply illustrated, and non exhaustive, including but not limited to above-mentioned optional mode.
It should also be noted that, the corresponding character types of the designated character for replacing the sensitivity character can be with the sensitivity character The corresponding character types of preset characters to match are identical.Specifically, terminal is in the definite sensitivity character and preset characters phase Timing, it is possible to obtain character types corresponding with the preset characters that the sensitivity character matches.For example, the terminal get with The corresponding character types of preset characters that the sensitivity character matches are obscene type, it is possible to determine specifying for the sensitivity character Character types corresponding to character are also obscene type.
Further, designated character corresponding with the salaciousness type can be the character of " * " form, which can incite somebody to action The sensitive character of the salaciousness type replaces with the designated character of " * " form.
As can be seen that in the embodiment of the present invention, by detecting the content node of webpage in destination document, and by content node In text node in character matched with the preset characters in preset characters group, then by the sensitivity in text node Character replaces with designated character, and the content node of the webpage is updated, and will finally replace specifying for the sensitivity character The color of character is arranged to the color of designated character corresponding with the sensitivity character types, may not need manual operation, automatic mistake Sensitive character is filtered, improves the legitimacy and rigor of webpage, while the color of designated character is subject to according to character types Distinguish, the type for the sensitive character for knowing to filter out easy to user, improve the flexibility of character processing.
Referring to Fig. 3, Fig. 3 is a kind of schematic block diagram of terminal provided in an embodiment of the present invention.Institute of the embodiment of the present invention The terminal of description, including:
Detection unit 301, for detecting the content node of webpage in destination document.
Matching unit 302, for extracting the text node in the content node, and by the character in text node and in advance If the preset characters in character group are matched.
Wherein, the character in the text node is included at least is given birth to by the character or non-back-end data of back-end data generation Into character.
Replacement unit 303, for the sensitive character in text node to be replaced with designated character.
Wherein, which is the character to match in text node with the preset characters.
Optionally, replacement unit 303, specifically for the character quantity of the sensitivity character in detection text node; When the sensitivity character in text node is replaced with designated character, the character quantity for determining the designated character is the sensitivity The character quantity of character.
As can be seen that in the embodiment of the present invention, by detecting the content node of webpage in destination document, and by content node In text node in character matched with the preset characters in preset characters group, then by the sensitivity in text node Character replaces with designated character, may not need manual operation, filters out sensitive character comprehensively, improves the legitimacy of webpage and tight Careful degree.
Referring to Fig. 4, Fig. 4 is the schematic block diagram of another terminal provided in an embodiment of the present invention.The embodiment of the present invention Described terminal, including:
Detection unit 401, for detecting the content node of webpage in destination document.
Matching unit 402, for extracting the text node in the content node, and by the character in the text node Matched with the preset characters in preset characters group, wherein, the character in the text node is included at least by back-end data The character of generation or the character of non-back-end data generation.
Replacement unit 403, for the sensitive character in the text node to be replaced with designated character, the sensitivity character For the character to match in the text node with the preset characters.
Optionally, the terminal further includes:First updating block 404, for preserving the text after being replaced processing This node, and the content node in the destination document is updated according to the text node of preservation.
Second updating block 405, for using the content node in the destination document after updating in the webpage Content node be updated.
Optionally, the preset characters group includes the preset characters of at least two character types, and character types are with specifying Character one-to-one corresponding, the corresponding character types of designated character of the replacement sensitivity character and the sensitive character match pre- If the corresponding character types of character are identical.
Optionally, the preset characters group includes the preset characters of at least two character types, and character types are with specifying The color of character corresponds.
The terminal further includes:Determination unit 406, for determining sensitive character types.
Wherein, the sensitive character types are the corresponding character types of designated character for replacing the sensitive character.
Setting unit 407, for the color for replacing the designated character of the sensitive character to be arranged to and the sensitive words Accord with the color of the corresponding designated character of type.
Optionally, the terminal further includes:Acquiring unit 408, for obtaining the webpage in browser, and by the webpage It is loaded into destination document.
As can be seen that in the embodiment of the present invention, by detecting the content node of webpage in destination document, and by content node In text node in character matched with the preset characters in preset characters group, then by the sensitivity in text node Character replaces with designated character, and the content node of the webpage is updated, and will finally replace specifying for the sensitivity character The color of character is arranged to the color of designated character corresponding with the sensitivity character types, may not need manual operation, automatic, complete Face filters out sensitive character, improves the legitimacy and rigor of webpage, while the face according to character types to designated character Color is distinguish between, the type for the sensitive character for knowing to filter out easy to user, improves the flexibility of character processing.
Fig. 5 is referred to, is the schematic block diagram of another terminal provided in an embodiment of the present invention.The present embodiment is described Terminal, including:At least one input equipment 1000;At least one processor 2000, such as CPU;At least one processor 3000; At least one output equipment 4000, above-mentioned input equipment 1000, processor 2000, memory 3000 and output equipment 4000 pass through Bus connects.
It should be appreciated that in embodiments of the present invention, above-mentioned input equipment 1000 can be the equipment to terminal input signal, It can include contact panel, can include touch-screen and touch screen etc. in the contact panel.Above-mentioned output equipment 4000 can wrap Include display (LCD etc.).
Above-mentioned processor 2000 can be central processing unit (Central Processing Unit, CPU), the processing Device can also be other general processors, digital signal processor (Digital Signal Processor, DSP), special collection Into circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
Above-mentioned memory 3000 can include read-only storage and random access memory, and provide and refer to processor 2000 Order and data.The a part of of memory 3000 can also include nonvolatile RAM.For example, memory 3000 is also Can be with the information of storage device type.Wherein, secure storage module 3001 can be included in the memory 3000, for specially depositing The data of safe handling were done in storage.
Specifically, above-mentioned processor 2000, for detecting the content node of webpage in destination document, extracts the content section Text node in point, and the character in the text node is matched with the preset characters in preset characters group, by institute State the sensitive character in text node and replace with designated character, the sensitivity character be in the text node with the predetermined word Accord with the character to match.
Optionally, the character in the text node includes at least the character by back-end data generation or non-back-end data The character of generation.
Optionally, above-mentioned processor 2000, is additionally operable to preserve the text node after being replaced processing, and according to guarantor The text node deposited updates the content node in the destination document, uses the content in the destination document after renewal Node is updated the content node in the webpage.
Optionally, the preset characters group includes the preset characters of at least two character types, and character types are with specifying Character one-to-one corresponding, the corresponding character types of designated character of the replacement sensitivity character and the sensitive character match pre- If the corresponding character types of character are identical.
Optionally, the preset characters group includes the preset characters of at least two character types, and character types are with specifying The color of character corresponds.
Optionally, above-mentioned processor 2000, is additionally operable to determine sensitive character types, the sensitivity character types are replacement institute State the corresponding character types of designated character of sensitive character;By the color for the designated character for replacing the sensitive character be arranged to The color of the corresponding designated character of the sensitivity character types.
Optionally, above-mentioned processor 2000, the character specifically for detecting the sensitive character in the text node Quantity;When the sensitive character in the text node is replaced with designated character, the character of the designated character is determined Quantity is the character quantity of the sensitive character.
Optionally, above-mentioned processor 2000, is additionally operable to obtain the webpage in browser, and the webpage is loaded into target In document.
As can be seen that in the embodiment of the present invention, by detecting the content node of webpage in destination document, and by content node In text node in character matched with the preset characters in preset characters group, then by the sensitivity in text node Character replaces with designated character, may not need manual operation, filters out sensitive character comprehensively, improves the legitimacy of webpage and tight Careful degree.
Another embodiment of the present invention also provides a kind of browser, which can be applied to terminal, specifically, this is browsed Device can perform the method described in above-mentioned first embodiment and second embodiment.
A kind of computer-readable recording medium, the computer-readable storage medium are provided in another embodiment of the invention Matter is stored with computer program, when the computer program is executed by processor, it is possible to achieve:Detect webpage in destination document Content node;The text node in the content node is extracted, and by the character in the text node and preset characters group Preset characters matched;Sensitive character in the text node is replaced with into designated character, the sensitivity character is institute State the character to match in text node with the preset characters.
It should be noted that the detailed process that the computer-readable recording medium is executed by processor can be found in the first implementation Method described in example and second embodiment, details are not described herein.
The computer-readable recording medium can be the internal storage unit of the terminal described in foregoing any embodiment, example Such as the hard disk or memory of terminal.The computer-readable recording medium can also be the External memory equipment of the terminal, such as The plug-in type hard disk being equipped with the terminal, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, the computer-readable recording medium can also be wrapped both Including the internal storage unit of the terminal also includes External memory equipment.The computer-readable recording medium is used to store described Other programs and data needed for computer program and the terminal.The computer-readable recording medium can be also used for temporarily When store the data that has exported or will export.
Those of ordinary skill in the art may realize that each exemplary list described with reference to the embodiments described herein Member and algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are performed with hardware or software mode actually, application-specific and design constraint depending on technical solution.Specially Industry technical staff can realize described function to each specific application using distinct methods, but this realization is not It is considered as beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, the end of foregoing description End and the specific work process of unit, may be referred to the corresponding process in preceding method embodiment, details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed terminal and method, can pass through it Its mode is realized.For example, device embodiment described above is only schematical, for example, the division of the unit, only Only a kind of division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can be tied Another system is closed or is desirably integrated into, or some features can be ignored, or do not perform.In addition, shown or discussed phase Coupling, direct-coupling or communication connection between mutually can be INDIRECT COUPLING or the communication by some interfaces, device or unit Connection or electricity, the connection of mechanical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple In network unit.Some or all of unit therein can be selected to realize the embodiment of the present invention according to the actual needs Purpose.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also It is that unit is individually physically present or two or more units integrate in a unit.It is above-mentioned integrated Unit can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to contribute in other words to the prior art, or all or part of the technical solution can be in the form of software product Embody, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment the method for the present invention Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey The medium of sequence code.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, various equivalent modifications can be readily occurred in or replaced Change, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection domain subject to.

Claims (10)

  1. A kind of 1. character processing method, it is characterised in that applied to the browser in terminal or terminal, the described method includes:
    Detect the content node of webpage in destination document;
    The text node in the content node is extracted, and will be default in the character in the text node and preset characters group Character is matched, and the character in the text node is included at least is given birth to by the character or non-back-end data of back-end data generation Into character;
    Sensitive character in the text node is replaced with into designated character, the sensitivity character in the text node with institute State the character that preset characters match.
  2. 2. according to the method described in claim 1, it is characterized in that, the sensitive character by the text node replaces with After designated character, further include:
    The text node after being replaced processing is preserved, and the destination document is updated according to the text node of preservation In content node;
    The content node in the webpage is updated using the content node in the destination document after renewal.
  3. 3. method as claimed in claim 2, it is characterised in that the preset characters group includes at least two character types Preset characters, character types are corresponded with designated character, replace the corresponding character types of designated character of the sensitive character It is identical with the corresponding character types of preset characters that the sensitive character matches.
  4. 4. method as claimed in claim 2, it is characterised in that the preset characters group includes at least two character types The color of preset characters, character types and designated character corresponds;
    Content node in the destination document using after renewal is updated it to the content node in the webpage Afterwards, further include:
    Determine sensitivity character types, the sensitivity character types are the corresponding character type of designated character for replacing the sensitive character Type;
    The color for the designated character for replacing the sensitive character is arranged to designated character corresponding with the sensitivity character types Color.
  5. 5. method as claimed in claim 4, it is characterised in that the sensitive character by the text node replaces with finger Determine character, including:
    Detect the character quantity of the sensitive character in the text node;
    When the sensitive character in the text node is replaced with designated character, the number of characters of the designated character is determined Measure as the character quantity of the sensitive character.
  6. 6. the method as described in claim 1, it is characterised in that in the detection destination document content node of webpage it Before, further include:
    The webpage in browser is obtained, and the webpage is loaded into destination document.
  7. 7. a kind of browser, applied to a terminal, it is characterised in that the browser includes being used to perform such as claim 1-6 Method described in middle any claim.
  8. 8. a kind of terminal, it is characterised in that the terminal includes being used to perform as described in any claim in claim 1-6 Method.
  9. 9. a kind of terminal, it is characterised in that the processor, defeated including processor, input equipment, output equipment and memory Enter equipment, output equipment and memory to be connected with each other, wherein, the memory is used to store application code, the processing Device is arranged to call said program code, performs such as claim 1-6 any one of them methods.
  10. A kind of 10. computer-readable recording medium, it is characterised in that the computer-readable storage medium is stored with computer program, The computer program includes programmed instruction, and described program instruction makes the processor perform such as right when being executed by a processor It is required that 1-6 any one of them methods.
CN201710945419.8A 2017-10-10 2017-10-10 A kind of character processing method and terminal Withdrawn CN107943782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710945419.8A CN107943782A (en) 2017-10-10 2017-10-10 A kind of character processing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710945419.8A CN107943782A (en) 2017-10-10 2017-10-10 A kind of character processing method and terminal

Publications (1)

Publication Number Publication Date
CN107943782A true CN107943782A (en) 2018-04-20

Family

ID=61935169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710945419.8A Withdrawn CN107943782A (en) 2017-10-10 2017-10-10 A kind of character processing method and terminal

Country Status (1)

Country Link
CN (1) CN107943782A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310418A (en) * 2020-02-25 2020-06-19 深圳市元征科技股份有限公司 Text extraction method and device
CN112685553A (en) * 2019-10-18 2021-04-20 小船出海教育科技(北京)有限公司 Method, device, equipment and medium for searching and replacing online document
CN113840101A (en) * 2020-06-24 2021-12-24 重庆山淞信息技术有限公司 Video image processing method and device based on FPGA
CN114117149A (en) * 2021-11-25 2022-03-01 深圳前海微众银行股份有限公司 Sensitive word filtering method and device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685553A (en) * 2019-10-18 2021-04-20 小船出海教育科技(北京)有限公司 Method, device, equipment and medium for searching and replacing online document
CN111310418A (en) * 2020-02-25 2020-06-19 深圳市元征科技股份有限公司 Text extraction method and device
CN113840101A (en) * 2020-06-24 2021-12-24 重庆山淞信息技术有限公司 Video image processing method and device based on FPGA
CN114117149A (en) * 2021-11-25 2022-03-01 深圳前海微众银行股份有限公司 Sensitive word filtering method and device and storage medium

Similar Documents

Publication Publication Date Title
CN103329131B (en) Tokenized search suggestions
CN103823813B (en) Electric terminal historical operation records processing method and processing device
CN104156201B (en) Apparatus and method for generating user interface
CN108038119A (en) Utilize the method, apparatus and storage medium of new word discovery investment target
CN104199603B (en) Browser webpage control method and device and terminal
CN107870706A (en) One kind management figure calibration method, terminal and computer-readable medium
CN107943782A (en) A kind of character processing method and terminal
CN108366096A (en) A kind of information subscribing method, terminal and computer readable storage medium
CN107357489A (en) A kind of synchronous method for browsing information, terminal and server
CN107491324A (en) A kind of method and terminal for installing application program
CN104240067A (en) Reminding setting method and device and electronic device
CN106127009A (en) The display packing of a kind of icon and terminal
CN107729109A (en) One kind management application drawing calibration method, terminal and computer-readable medium
CN105378604B (en) Trend suggestion
CN106547895A (en) A kind of extracting method and device of info web
CN106250111A (en) A kind of wallpaper acquisition methods and terminal
CN108280146A (en) A kind of control method, terminal device and the computer-readable medium of push content
CN106383752A (en) Browser page abnormity recovery processing method and device
CN108388386A (en) A kind of information processing method, terminal device and computer readable storage medium
CN107436836A (en) The processing method and relevant device of a kind of journal file
CN109828715A (en) Record screen method and device
CN107729306A (en) A kind of text handling method, terminal and computer-readable medium
CN108133048A (en) file ordering method, device and mobile terminal
CN107862007A (en) A kind of graphing database design method, terminal device and computer-readable medium
CN105955586A (en) Method and apparatus for displaying definition of keyword in terminal

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180420