Embodiment
Below in conjunction with accompanying drawing, the method for display text provide the embodiment of the present invention and the embodiment of device are described in detail.
The method of the display text that the embodiment of the present invention provides, as shown in Figure 1, specifically comprises the following steps:
The character quantity parameter value of step 101, detection text;
Step 102, when character quantity parameter value is positioned at preset range, display text alphabet.
Wherein, above-mentioned text is mainly used in recording and storing Word message, instead of image, sound and formatted data, and the extension name of common text document has .txt .doc. .docx .wps etc.
Preferably, in one embodiment, preset range is made up of the numerical value between two end points and two end points, and the first end point value of preset range is less than the second endpoint value of preset range.Thus, when character quantity parameter value is less than first end point value, the alphabet of display text; When character quantity parameter value is greater than the second endpoint value, display text character number parameter value is less than the character portion of first end point value, and the number parameter value that hides character is not less than the character portion of first end point value.
Such as: preset range is 5 walk to 10 row, and its first end point value is the 5, second endpoint value is 10, and when the character quantity parameter value of text is 4 row, it is less than first end point value 5, then show the alphabet of text; When the character quantity parameter value of text is 8 row, be positioned at preset range, then show the alphabet of text; When the character quantity parameter value of text is 15 row, be greater than the second endpoint value 10, that is the character portion that display text character number parameter value is less than first end point value the 1st walks to the 4th row, and that is the character portion that the number parameter value that hides character is not less than first end point value the 5th walks to the 15th row.
Preferably, in one embodiment, receive after upgrading preset range instruction, the numerical value according to input upgrades preset range.Preset range can carry out renewal amendment, such as, preset range is walked to 10 row by 5 and revises and be updated to 7 and walk to 10 row.User, when operating, by clicking the option of amendment preset range, demonstrating the interface of amendment preset range, this interface can have scope input frame, input numerical value voluntarily by user; Also can have value range preset selective item, be convenient to user and directly select input numerical value in multiple option.After input numerical value to be determined, the processor to terminal (as mobile phone, computer etc.) sends and upgrades preset range instruction, and terminal upgrades preset range according to the numerical value of input again.
Preferably, in one embodiment, when character quantity parameter value is character line number, detects the character quantity parameter value of text, comprising: whether the often row of text of lining by line scan has character; If have character, then the character quantity parameter value of accumulative text adds one; If not there is character, then detect complete.
Preferably, in one embodiment, when character quantity parameter value is character number, detects the character quantity parameter value of text, comprising: whether there is character according to the current character position of the scan text one by one of order from top to bottom, from left to right; If have character, then the character quantity parameter value of accumulative text adds one; If not there is character, then detect complete.
Can be found out by foregoing description, the method for the display text that the embodiment of the present invention provides, the character quantity had by detection text, whether at preset range, determines display text alphabet, or a display part, hiding a part of text character.Like this, number of characters can be made to be greater than preset range first end point value and to be less than the text display full content of the second endpoint value, after avoiding user to put out hiding content, only occurring the situation of one or two character.Decrease processing load, the content of display text, reduces the interaction times of terminal and server, reduces costs flexibly, improves Consumer's Experience.
Preset range is made up of the numerical value between two end points and two end points, and the first end point value of preset range is less than the second endpoint value of preset range.When alphabetic character number parameter value is alphabetic character line number, suppose that first end point value be the 6, second endpoint value is 12, as shown in Figure 2, the method that the embodiment of the present invention provides, comprises the following steps:
Step 201, acquisition need the text shown; Such as, in the forum text such as pre-release model.
Whether the often row of step 202, text of lining by line scan has character; If have character, then perform step 203; Otherwise, detect complete, perform step 204;
The alphabetic character line number of step 203, accumulative text adds one, performs step 202;
The character line number of step 204, acquisition text, and preset range;
Step 205, judge whether character line number is positioned at preset range, if be positioned at, perform step 206; Otherwise, perform step 207;
Whole alphabetic characters of step 206, display text.
Step 207, judge the magnitude relationship of the endpoint value of character line number and preset range; When character line number is less than first end point value 6, perform step 206; When alphabetic character line number is greater than the second endpoint value 12, perform step 208;
Step 208, text importing the 1st walks to the content of the 5th row, the content that hidden text 5 row is later.
Can be found out by the description of the present embodiment, the method that the embodiment of the present invention provides, the character quantity had by detection text, whether at preset range, determines display text alphabet, or a display part, hiding a part of text character.Like this, number of characters can be made to be greater than preset range first end point value and to be less than the text display full content of the second endpoint value, after avoiding user to put out hiding content, only occurring the situation of one or two character.Decrease processing load, the content of display text, reduces the interaction times of terminal and server, reduces costs flexibly, improves Consumer's Experience.
Preset range is made up of the numerical value between two end points and two end points, and the first end point value of preset range is less than the second endpoint value of preset range.When character quantity parameter value is character number, suppose that first end point value be the 70, second endpoint value is 90, as shown in Figure 3, the method that the embodiment of the present invention provides, comprises the following steps:
Step 301, acquisition need the text shown;
Step 302, whether there is character according to the current character position of the scan text one by one of order from top to bottom, from left to right; If have character, then perform step 303; Otherwise, detect complete, perform step 304;
The character number of step 303, accumulative text adds one, performs step 302;
The character number of step 304, acquisition text, and preset range;
Step 305, judge whether character number is positioned at preset range, if be positioned at, perform step 306; Otherwise, perform step 307;
The alphabet of step 306, display text.
Step 307, judge the magnitude relationship of the endpoint value of character number and preset range; When character number is less than first end point value 70, perform step 306; When character number is greater than the second endpoint value 90, perform step 308;
The content of step 308, display character 1 to character 70, hide character 70 later contents.
Can be found out by the description of the present embodiment, the method that the embodiment of the present invention provides, the character quantity had by detection text, whether at preset range, determines display text alphabet, or a display part, hiding a part of text character.Like this, number of characters can be made to be greater than preset range first end point value and to be less than the text display full content of the second endpoint value, after avoiding user to put out hiding content, only occurring the situation of one or two character.Decrease processing load, the content of display text, reduces the interaction times of terminal and server, reduces costs flexibly, improves Consumer's Experience.
Based on same inventive concept, the embodiment of the present invention additionally provides a kind of device showing text, the principle of dealing with problems due to this device is similar to a kind of aforementioned method showing text, and therefore the enforcement of this device see the enforcement of method, can repeat part and repeat no more.
A kind of device showing text that the embodiment of the present invention provides, as shown in Figure 4, comprising:
Detection module 401, for detecting the character quantity parameter value of text;
Display module 402, for when character quantity parameter value is positioned at preset range, the alphabet of display text.
Preferably, when character quantity parameter value is less than first end point value, display module 402 shows the alphabet of text; When character quantity parameter value is greater than described second endpoint value, display module shows the character portion that 402 text character number parameter values are less than first end point value, and the number parameter value that hides character is not less than the character portion of first end point value; Wherein, preset range is made up of the numerical value between two end points and two end points, and the first end point value of preset range is less than the second endpoint value of preset range.
Preferably, this device also comprises:
Update module 403, after receiving the instruction of renewal preset range, the numerical value according to input upgrades preset range.
Preferably, when character quantity parameter value is character line number, detection module 401 line by line scan text often row whether there is character; If have character, then the character quantity parameter value of accumulative text adds one; If not there is character, then detect complete.
Preferably, when character quantity parameter value is character number, whether detection module 401 has character according to the current character position of the scan text one by one of order from top to bottom, from left to right; If have character, then the character quantity parameter value of accumulative described text adds one; If not there is character, then detect complete.
Known by foregoing description, the method for the display text that the embodiment of the present invention provides and device, the character quantity had by detection text, whether at preset range, determines display text alphabet, or a display part, hiding a part of text character.Like this, number of characters can be made to be greater than preset range first end point value and to be less than the text display full content of the second endpoint value, after avoiding user to put out hiding content, only occurring the situation of one or two character.Decrease processing load, the content of display text, reduces the interaction times of terminal and server, reduces costs flexibly, improves Consumer's Experience.
Through the above description of the embodiments, those skilled in the art can be well understood to the embodiment of the present invention can by hardware implementing, and the mode that also can add necessary general hardware platform by software realizes.Based on such understanding, the technical scheme of the embodiment of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions and perform method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.