Summary of the invention
The embodiment of the present invention is designed to provide a kind of document translation method, apparatus, electronic equipment and readable storage mediumMatter, rapidly to obtain the target translation document of the document, and can be convenient user to the document and the target translation document intoRow control is read.
In a first aspect, being applied to document the embodiment of the invention provides a kind of document display method and reading client, the partyMethod may include:
When detect document read opened in client have document when, judge whether to receive the translation for document and refer toIt enables;
If so, the ident value of the content for unique identification document is obtained, as target identification value;
Obtain the corresponding target translation document of target identification value, wherein target translation document is based on the first mapping relationsWhat table and target identification value were found, record has the corresponding relationship between ident value and translation document in the first mapping table;
In two windows that document reads that client is shown, a window displaying target translation document, another windowShow document.
Optionally, the ident value for obtaining the content for unique identification document, the step of as target identification value, can wrapIt includes:
The MD5 value that the content of document is calculated using message digest algorithm MD5, as target identification value.
Optionally, the step of obtaining target identification value corresponding target translation document may include:
Judge whether the quantity of the corresponding translation document of target identification value is greater than one;
If more than one, in the second mapping table, the user of the corresponding each translation document of target identification value is searchedScore value;Wherein, recording in the second mapping table has: the corresponding relationship of translation document and user's score value;
By the corresponding translation document of highest user's score value in each user's score value found, translated as targetDocument.
Optionally, the step of obtaining target identification value corresponding target translation document may include:
Judge whether target identification value is corresponding with translation document;
If not being corresponding with translation document, calls default translation software to translate document, obtains the translation document of document,As target translation document.
Optionally, it is calling translation software to translate document, is obtaining the translation document of document, translating text as targetAfter shelves, this method can also include:
The corresponding relationship of the target identification value of document and target translation document is stored into the first mapping table.
Optionally, in two windows that document reads that client is shown, a window displaying target translation document is anotherBefore a window shows the step of document, method further include:
The display interface that document reads client is divided into two windows;Wherein, two windows be left and right distribution or onLower distribution.
Optionally, in two windows that document reads that client is shown, a window displaying target translation document is anotherAfter a window shows the step of document, this method can also include:
Obtain the score value that Adds User that user is directed to target translation document;
Using the score value that Adds User, the corresponding user's score value of target translation document in the second mapping table is updated.
Optionally, in two windows that document reads that client is shown, a window displaying target translation document is anotherAfter a window shows the step of document, changing method can also include:
Judge whether that the translation content received in target translation document and/or the revision for translating content format refer toIt enables;
If receiving revision instruction, using revision instruction, to revision indicated by revision instruction, in target translation documentTranslation content and/or translation content format are revised, and amendment translation document is obtained;
To amendment translation document addition revision mark, and the amendment translation document after addition revision mark is stored.
Second aspect, the embodiment of the invention provides a kind of document display devices, are applied to document and read client, the dressIt sets and may include:
First judging unit, for judging whether to receive when detecting that opening has document in document reading clientFor the interpretive order of document;
First obtains unit, for obtaining for unique identification document when receiving the interpretive order for documentThe ident value of content, as target identification value;
Second obtaining unit, for obtaining the corresponding target translation document of target identification value, wherein target translation document isIt is found based on the first mapping table and target identification value, record has ident value and translation document in the first mapping tableBetween corresponding relationship;
Display unit, in two windows that document reads that client is shown, a window displaying target translation to be literaryShelves, another window show document.
Optionally, first obtains unit is specifically used for:
The MD5 value that the content of document is calculated using message digest algorithm MD5, as target identification value.
Optionally, the second obtaining unit may include:
First judgment sub-unit, for judging whether the quantity of the corresponding translation document of target identification value is greater than one;
Subelement is searched, when being greater than one for the quantity in the corresponding translation document of target identification value, in the second mappingIn relation table, user's score value of the corresponding each translation document of target identification value is searched;Wherein, it is recorded in the second mapping tableHave: the corresponding relationship of translation document and user's score value;
Subelement is obtained, for the corresponding translation of highest user's score value in each user's score value found is literaryShelves, as target translation document.
Optionally, the second obtaining unit may include:
Second judgment sub-unit, for judging whether target identification value is corresponding with translation document;
Subelement is called, for when target identification value is not corresponding with translation document, calling default translation software to documentIt is translated, obtains the translation document of document, as target translation document.
Optionally, in embodiments of the present invention, which can also include:
First storage unit, for call translation software document is translated, obtain the translation document of document, asAfter target translation document, by the corresponding relationship of the target identification value of document and target translation document, stores to the first mapping and closeIt is in table.
Optionally, in embodiments of the present invention, which can also include:
Window division unit, in two windows that document reads that client is shown, a window displaying target to be turned overBefore the step of translation shelves, another window shows document, the display interface that document reads client is divided into two windows;Wherein, two windows are left and right distribution or distribution up and down.
Optionally, in embodiments of the present invention, which can also include:
Third obtaining unit, in two windows that document reads that client is shown, a window displaying target to be turned overTranslation shelves after another window shows document, obtain the score value that Adds User that user is directed to target translation document;
Updating unit, for it is corresponding to update target translation document in the second mapping table using the score value that Adds UserUser's score value.
Optionally, in embodiments of the present invention, which can also include:
Second judgment unit, in two windows that document reads that client is shown, a window displaying target to be turned overTranslation shelves, another window show document after, judge whether the translation content received in target translation document and/orTranslate the revision instruction of content format;
Revise unit, for when receiving revision instruction, using revision instruction, to revision indicated by revision instruction,Translation content and/or translation content format in target translation document are revised, and amendment translation document is obtained;
Second storage unit, for being identified to amendment translation document addition revision, and to the amendment after addition revision markTranslation document is stored.
The third aspect, the embodiment of the invention also provides a kind of electronic equipment, including processor, communication interface, memoryAnd communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;On electronic equipmentDocument is installed and reads client;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any one of first aspect embodiment of the methodMethod and step.
Fourth aspect, the embodiment of the invention also provides a kind of readable storage medium storing program for executing, readable storage medium storing program for executing is electronic equipmentOn readable storage medium storing program for executing, document is installed on electronic equipment and reads client, is stored with computer journey in readable storage medium storing program for executingSequence realizes the method and step of any one of first aspect embodiment of the method when computer program is executed by processor.
In embodiments of the present invention, when reading client one document of reading using document, the document reads client canTo judge whether to receive the interpretive order for the document.It, can be with when judgement receives the interpretive order for the documentThe ident value for obtaining the content for unique identification the document, as target identification value.It is then possible to obtain according to the first mappingTable is found, the corresponding target translation document of the target identification value.Wherein, due in the first mapping table record have ident value andThe corresponding relationship of translation document, thus target translation can be rapidly acquired by the target identification value and the first mapping tableDocument.Furthermore it is also possible to shown respectively in two windows show of display interface that the document reads client the document withThe target translation document carries out control reading to the original text and translation of the document in this way, can be convenient user.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
In order to solve the problems in the existing technology, the embodiment of the invention provides a kind of document display method, device,Electronic equipment and readable storage medium storing program for executing.
Document display method provided in an embodiment of the present invention is illustrated first below.
Wherein, document involved in the embodiment of the present invention includes but is not limited to: PDF (Portable DocumentFormat, portable document format) document, word document and PPT (PowerPoint, PowerPoint) document.Correspondingly, documentRead client are as follows: PDF document reads client, word document reads client and PPT document reads client.
Referring to Fig. 1, document display method provided in an embodiment of the present invention is applied to document and reads client, and this method can be withInclude the following steps:
S101: when detecting that opening has document in document reading client, judge whether to receive for the documentInterpretive order;
S102: if judgement receives the interpretive order for the document, the content for unique identification the document is obtainedIdent value, as target identification value;
S103: the corresponding target translation document of target identification value is obtained, wherein target translation document is based on the first mappingWhat relation table and target identification value were found, record has the corresponding pass between ident value and translation document in the first mapping tableSystem;
S104: in two windows that document reads that client is shown, a window displaying target translation document, anotherWindow shows the document.
In embodiments of the present invention, when reading client one document of reading using document, the document reads client canTo judge whether to receive the interpretive order for the document.It, can be with when judgement receives the interpretive order for the documentThe ident value for obtaining the content for unique identification the document, as target identification value.It is then possible to obtain according to the first mappingTable is found, the corresponding target translation document of the target identification value.Wherein, due in the first mapping table record have ident value andThe corresponding relationship of translation document, thus target translation can be rapidly acquired by the target identification value and the first mapping tableDocument.Furthermore it is also possible to shown respectively in two windows show of display interface that the document reads client the document withThe target translation document carries out control reading to the original text and translation of the document in this way, can be convenient user.
It is understood that the ident value of the content for unique identification the document is obtained, one as target identification valueKind of implementation can be with are as follows: calculates this article using MD5 (Message-Digest Algorithm 5, message digest algorithm 5)The MD5 value of the content of shelves, and using the MD5 value as target identification value.In this way, can be by the MD5 value come unique identification this articleThe content of shelves, and then can use the MD5 value accurately to search the corresponding translation document of the document.
Wherein, when calculated MD5 value is as target identification value, pair that is recorded in first mapping tableIdent value in should being related to should be also based on what MD5 algorithm was calculated.In addition, the MD5 value being calculated can be baseIt is calculated in the full content of the document, is also possible to what the partial content based on the document was calculated, this is all to closeReason.
It is of course also possible to using SHA (Secure Hash Algorithm, secure hash algorithm), or, RIPEMD (RACEIntegrity Primitives Evaluation Message Digest, RACE raw integrity verification message abstract) etc.Algorithm calculates the digest value of the content of the document, and using the digest value being calculated as target identification value, this is reasonable.
Wherein, when the digest value being calculated using SHA algorithm is as when target identification value, in first mapping tableIdent value in the corresponding relationship of record should be also based on what SHA algorithm was calculated.It is calculated when using RIPEMD algorithmWhen the digest value arrived is as target identification value, the ident value in corresponding relationship recorded in first mapping table should be alsoIt is calculated based on RIPEMD algorithm.
It reads in client, also can store in the document in the document in addition, first mapping table can storeIt reads in the corresponding cloud server of client.
Wherein, when the first mapping table is stored when the document reads client, document is read client and is being somebody's turn to doAfter the target identification value of document, the target identification value can be searched in the first mapping table.When the target can be foundWhen ident value, then according to the corresponding relationship between the ident value and translation document recorded in first mapping table, findThe corresponding translation document of target identification value.
Then, the document, which reads client, may determine that whether the quantity of the corresponding translation document of target identification value is greater than oneIt is a.If more than one, then in the second mapping table that the document reads client storage, it is corresponding to search target identification valueUser's score value of each translation document.Wherein, recording in second mapping table has: the correspondence of translation document and user's score valueRelationship.To which the document reads client can be corresponding by highest user's score value in each user's score value foundTranslation document, as target translation document.It is, text can be translated using the best translation document of translation quality as targetShelves.
If judging, the quantity of the corresponding translation document of target identification value no more than one, can also determine whether to be equal to oneIt is a.If being equal to one, corresponding translation document of target identification value for directly finding this, as target translation document.
If being not equal to one, show that the target identification value is not corresponding with translation document, at this point, the document reads clientDefault translation software can be called to translate the document, obtain the translation document of the document.It at this time can be by translation textShelves are used as target translation document, and the corresponding relationship of the target identification value of the document and the target translation document can be storedInto the first mapping table.Wherein, which can be set according to the actual situation by those skilled in the artFixed, it is not described here in detail.
Wherein, if in the document include picture, software for discerning characters, such as OCR (Optical be can useCharacter Recognition, optical character identification) software, identification obtains the text for including in the picture, then by pre-If the text that translation software obtains the identification is translated.
When first mapping table stores in cloud server, document reads client in the mesh for obtaining the documentAfter marking ident value, which can be sent to cloud server.Cloud server receives the target identification value, andThe target identification value is searched in first mapping table, when that can find the target identification value, first can be reflected according to thisThe corresponding relationship between the ident value and translation document recorded in relation table is penetrated, the corresponding translation text of the target identification value is foundShelves.
Then, which can obtain the mesh according to the second mapping table stored in the cloud serverMark user's score value of the corresponding each translation document of ident value.And the highest user in each user's score value of acquisition is commentedThen the target translation document is sent to the document and reads client by the corresponding translation document of score value as target translation documentEnd, this is reasonable.Wherein, cloud server obtains the concrete operations of target translation document, may refer to document and reads clientEnd obtains the operation of target translation document, and this will not be repeated here.
It is understood that the document, which reads client, is translating text to the document and the target respectively using two windowsBefore shelves are shown, the display interface that the document reads client can be divided into two windows.Wherein, it respectively obtainsTwo windows can be left and right distribution, can also be distributed up and down.It is of course also possible to which the document to be read to the display of clientInterface is divided into two windows according to preset ratio size, and the size of the two windows is not identical, this is reasonable.
In addition, showing the target translation document in a window, after another window shows the document, the document is readClient can also obtain the score value that Adds User that user is directed to the target translation document.And it is based on the scoring that Adds UserValue updates the corresponding user's score value of target translation document in the second mapping table.
Wherein, update mode can be with are as follows: to the corresponding user's score value of target translation document in the second mapping table withThe score value that Adds User takes mean value with value, and replaces target translation document in the second mapping table using the mean value and correspond toUser's score value, be not limited thereto certainly.
Certainly, the target translation document is shown in a window, after another window shows the document, the document is readClient can also determine whether the translation content received in target translation document and/or translate the revision of content formatInstruction.
If receiving revision instruction, using revision instruction, to revision indicated by revision instruction, in target translation documentTranslation content and/or translation content format are revised, and amendment translation document is obtained.For example, user will be in target translation documentEnglish word " is " in first segment a word is revised as " are ", then, the document reads client and is detecting above-mentioned repairAfter changing instruction, " is " in the target translation document in first segment a word can be revised as " are ", obtain amendment translationDocument.Also, revision mark can also be added to the amendment translation document: the ×× time is by " is " in first segment a wordIt is revised as " are ", is not limited thereto certainly.Then, which is stored.
To sum up, using document display method provided in an embodiment of the present invention, the target translation of document can rapidly be obtainedDocument, and can be convenient user and control reading is carried out to the document and the target translation document.
Corresponding to above-mentioned document display method embodiment, the embodiment of the present invention also provides can a kind of document display device.
Referring to fig. 2, document display device provided in an embodiment of the present invention is applied to document and reads client, and the document is aobviousShowing device may include:
First judging unit 201, for judging whether to receive when detecting that opening has document in document reading clientTo the interpretive order for being directed to document;
First obtains unit 202, for obtaining and being used for unique identification document when receiving the interpretive order for documentContent ident value, as target identification value;
Second obtaining unit 203, for obtaining the corresponding target translation document of target identification value, wherein target translation textShelves are found based on the first mapping table and target identification value, and record has ident value and translation in the first mapping tableCorresponding relationship between document;
Display unit 204, in two windows that document reads that client is shown, a window displaying target to be translatedDocument, another window show document.
Using document display device provided in an embodiment of the present invention, when reading client one document of reading using document,The document reads client and can decide whether to receive the interpretive order for the document.When judgement is received for the documentInterpretive order when, the ident value of the content for unique identification the document can be obtained, as target identification value.Then, may be usedTo obtain find according to the first mapping table, the corresponding target translation document of the target identification value.Wherein, due to the first mappingRecord has the corresponding relationship of ident value and translation document in table, thus can be quick by the target identification value and the first mapping tableGround finds the target translation document.Furthermore it is also possible to two windows shown in the display interface that the document reads clientIt is middle to show the document and the target translation document respectively, the original text and translation of the document are carried out pair in this way, can be convenient userAccording to reading.
Optionally, in embodiments of the present invention, first obtains unit 202 is specifically used for:
The MD5 value that the content of document is calculated using message digest algorithm MD5, as target identification value.
Optionally, in one implementation, the second obtaining unit 203 may include:
First judgment sub-unit, for judging whether the quantity of the corresponding translation document of target identification value is greater than one;
Subelement is searched, when being greater than one for the quantity in the corresponding translation document of target identification value, in the second mappingIn relation table, user's score value of the corresponding each translation document of target identification value is searched;Wherein, it is recorded in the second mapping tableHave: the corresponding relationship of translation document and user's score value;
Subelement is obtained, for the corresponding translation of highest user's score value in each user's score value found is literaryShelves, as target translation document.
Optionally, in another implementation, the second obtaining unit 203 may include:
Second judgment sub-unit, for judging whether target identification value is corresponding with translation document;
Subelement is called, for when target identification value is not corresponding with translation document, calling default translation software to documentIt is translated, obtains the translation document of document, as target translation document.
Optionally, in embodiments of the present invention, which can also include:
First storage unit, for call translation software document is translated, obtain the translation document of document, asAfter target translation document, by the corresponding relationship of the target identification value of document and target translation document, stores to the first mapping and closeIt is in table.
Optionally, in embodiments of the present invention, device can also include:
Window division unit, in two windows that document reads that client is shown, a window displaying target to be turned overBefore the step of translation shelves, another window shows document, the display interface that document reads client is divided into two windows;Wherein, two windows are left and right distribution or distribution up and down.
Optionally, in embodiments of the present invention, which can also include:
Third obtaining unit, in two windows that document reads that client is shown, a window displaying target to be turned overTranslation shelves after another window shows document, obtain the score value that Adds User that user is directed to target translation document;
Updating unit, for it is corresponding to update target translation document in the second mapping table using the score value that Adds UserUser's score value.
Optionally, in embodiments of the present invention, device can also include:
Second judgment unit, in two windows that document reads that client is shown, a window displaying target to be turned overTranslation shelves, another window show document after, judge whether the translation content received in target translation document and/orTranslate the revision instruction of content format;
Revise unit, for when receiving revision instruction, using revision instruction, to revision indicated by revision instruction,Translation content and/or translation content format in target translation document are revised, and amendment translation document is obtained;
Second storage unit, for being identified to amendment translation document addition revision, and to the amendment after addition revision markTranslation document is stored.
Wherein, since present apparatus embodiment is substantially similar to embodiment of the method, so being described relatively simple, related placeReferring to the explanation of above method embodiment part.
Corresponding to above-mentioned document display method embodiment, the embodiment of the invention also provides a kind of electronic equipment.
Referring to Fig. 3, which includes processor 301, communication interface 302, memory 303 and communication bus 304,In, processor 301, communication interface 302, memory 303 completes mutual communication by communication bus 304;The electronic equipmentOn be equipped with document read client;
Memory 303, for storing computer program;
Processor 301 when for executing the program stored on memory 303, realizes any of the above-described document display methodThe method and step of embodiment.
Using electronic equipment provided in an embodiment of the present invention, when reading client one document of reading using document, this articleShelves read client and can decide whether to receive the interpretive order for the document.When judgement receives turning over for the documentWhen translating instruction, the ident value of the content for unique identification the document can be obtained, as target identification value.It is then possible to obtainObtain find according to the first mapping table, the corresponding target translation document of the target identification value.Wherein, due in the first mapping tableRecord has the corresponding relationship of ident value and translation document, thus can rapidly be looked by the target identification value and the first mapping tableFind the target translation document.Furthermore it is also possible to divide in two windows that the display interface that the document reads client is shownThe document and the target translation document are not shown, are read in this way, can be convenient user and carry out control to the original text and translation of the documentIt reads.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral ComponentInterconnect, PCI) bus or expanding the industrial standard structure (Extended Industry StandardArchitecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For justIt is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easyThe property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used alsoTo be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital SignalProcessing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existingIt is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discreteDoor or transistor logic, discrete hardware components.
Corresponding to above-mentioned document display method embodiment, the embodiment of the invention also provides a kind of readable storage medium storing program for executing.
The readable storage medium storing program for executing is the readable storage medium storing program for executing on electronic equipment, and document is equipped on electronic equipment and reads clientHold, be stored with computer program in readable storage medium storing program for executing, realization when computer program is executed by processor: any of the above-described document is aobviousShow the method and step of embodiment of the method.
In embodiments of the present invention, when reading client one document of reading using document, the document reads client canTo judge whether to receive the interpretive order for the document.It, can be with when judgement receives the interpretive order for the documentThe ident value for obtaining the content for unique identification the document, as target identification value.It is then possible to obtain according to the first mappingTable is found, the corresponding target translation document of the target identification value.Wherein, due in the first mapping table record have ident value andThe corresponding relationship of translation document, thus target translation can be rapidly found by the target identification value and the first mapping tableDocument.Furthermore it is also possible to shown respectively in two windows show of display interface that the document reads client the document withThe target translation document carries out control reading to the original text and translation of the document in this way, can be convenient user.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a realityBody or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operationIn any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended toNon-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including thoseElement, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipmentIntrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded thatThere is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodimentDividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,For electronic equipment and readable storage medium storing program for executing embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simpleSingle, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is allAny modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present inventionIt is interior.