CN111046635A - Method and device for manufacturing freemarker template, computer equipment and storage medium - Google Patents

Method and device for manufacturing freemarker template, computer equipment and storage medium Download PDF

Info

Publication number
CN111046635A
CN111046635A CN201911282643.9A CN201911282643A CN111046635A CN 111046635 A CN111046635 A CN 111046635A CN 201911282643 A CN201911282643 A CN 201911282643A CN 111046635 A CN111046635 A CN 111046635A
Authority
CN
China
Prior art keywords
format
tool
preset
text
word document
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.)
Granted
Application number
CN201911282643.9A
Other languages
Chinese (zh)
Other versions
CN111046635B (en
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 Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanrong Lianyi Information Technology Service 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 Qianhai Huanrong Lianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Priority to CN201911282643.9A priority Critical patent/CN111046635B/en
Publication of CN111046635A publication Critical patent/CN111046635A/en
Application granted granted Critical
Publication of CN111046635B publication Critical patent/CN111046635B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a method, a device, computer equipment and a storage medium for manufacturing a freemarker template, wherein the method comprises the following steps: receiving a word document submitted by a user; carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format; performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text; performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text; and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template. By the method, the manufacturing efficiency of the freemarker template is greatly improved, and human errors are reduced.

Description

Method and device for manufacturing freemarker template, computer equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for manufacturing a freemarker template, computer equipment and a storage medium.
Background
In the prior art, the service text formats of the same type of users are basically consistent, but the contents displayed by different types of users are different, so that a corresponding freemarker template needs to be generated in advance according to a provided word document. However, in the process of manufacturing the template, the steps are repeated, time and labor are consumed, and errors are easy to occur. Therefore, the prior art method has the problems of complex process and repeated manufacturing steps for manufacturing the freemarker template.
Disclosure of Invention
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for manufacturing a freemarker template, and aims to solve the problems that in the prior art, the process of manufacturing the freemarker template is complex and the manufacturing steps are repeated.
In a first aspect, an embodiment of the present invention provides a method for manufacturing a freemarker template, including:
receiving a word document submitted by a user;
carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format;
performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text;
performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text;
and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template.
In a second aspect, an embodiment of the present invention provides an apparatus for making a freemarker template, including:
the word document receiving unit is used for receiving a word document submitted by a user;
the format processing unit is used for carrying out format processing on the word document according to a format processing tool in a preset tool kit so as to generate a word document in a preset format;
the first text format conversion unit is used for carrying out format conversion on the word document in the preset format according to a first format conversion tool in the tool kit so as to generate a first preset text;
the second text format conversion unit is used for carrying out format conversion on the first preset text according to a second format conversion tool in the tool kit so as to generate a second preset text;
and the text formatting unit is used for formatting the second preset text according to a formatting tool in the tool kit so as to generate a freemarker template.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the method for making a freemarker template described in the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for making a freemarker template according to the first aspect.
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for manufacturing a freemarker template, wherein the method comprises the following steps: receiving a word document submitted by a user; carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format; performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text; performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text; and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template. By the method, the manufacturing efficiency of the freemarker template is greatly improved, and human errors are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for making a freemarker template according to an embodiment of the present invention;
FIG. 2 is a schematic view of a sub-flow of a method for making a freemarker template according to an embodiment of the present invention;
FIG. 3 is a schematic view of another sub-flow of a method for making a freemarker template according to an embodiment of the present invention;
FIG. 4 is a schematic block diagram of an apparatus for fabricating a freemarker template according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of an apparatus provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for making a freemarker template according to an embodiment of the present invention. The method for manufacturing the freemarker template is applied to the user terminal, the method is executed through application software installed in the user terminal, and the user terminal is terminal equipment, such as a desktop computer, a notebook computer, a tablet computer or a mobile phone and the like, used for executing the method for manufacturing the freemarker template so as to realize the freemarker template manufacturing. In the embodiment of the invention, the terminal equipment for realizing the method for making the freemarker template is configured with the toolkit in advance, for example, a project for making the freemarker template is established in a java development tool, and the toolkit is set up in the project, wherein the toolkit can be a jar kit required for making the freemarker template, and the freemarker template is made by calling a plurality of tools in the toolkit.
As shown in fig. 1, the method includes steps S110 to S150.
And S110, receiving a word document submitted by a user.
And receiving a word document submitted by a user. Specifically, the execution main body for receiving the word document submitted by the user in the embodiment of the present invention may be a terminal device for receiving the word document, and the terminal device may be a hardware device such as a desktop computer, a notebook computer, a tablet computer, or a mobile phone.
And S120, carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format.
And carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate the word document in a preset format. Specifically, a project for manufacturing a freemarker template is established in a java development tool, and the toolkit is established in the project, wherein the toolkit can be a jar package required for manufacturing the freemarker template, and the word document is subjected to format processing by calling a format processing tool in the toolkit to generate a word document in a preset format.
In an embodiment, as shown in fig. 2, step S120 includes sub-steps S121 and S122.
S121, judging the format of the word document according to the format judgment tool to obtain the format type of the word document.
And judging the format of the word document according to the format judgment tool to obtain the format type of the word document. Specifically, the format judgment tool judges a suffix of the word document to obtain a format type of the word document. For example, if the suffix of the word document submitted by the receiving user is a doc suffix, the word document input by the receiving user is judged to be a doc type file.
And S122, if the format type of the word document does not accord with a preset format, carrying out format conversion on the word document according to the format conversion tool so as to obtain the word document which accords with the preset format.
And if the format type of the word document does not accord with a preset format, carrying out format conversion on the word document according to the format conversion tool so as to obtain the word document which accords with the preset format. Specifically, the format conversion tool may convert a word document with doc suffix into a word document with doc suffix, or may convert a word document with doc suffix into a word document with doc suffix, and the format conversion tool performs format conversion on a word document which does not conform to the preset format according to the preset format. For example, if the preset format is doc format and the format of the word document is docx format, the format of the word document is converted into the word document in doc format by the format conversion tool.
S130, performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text.
And performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text. The first format conversion tool is used for converting the word document in the preset format into a first preset text, and the first preset text is a text of a markup language type, so that the first preset text can be a text in an xml format, a text in an xhtml format, and a text in a tex format.
In another embodiment, step S130 is followed by step S130 a.
S130a, repairing the first preset text according to the text repairing tool in the toolkit to obtain a repaired first preset text.
And repairing the first preset text according to a text repairing tool in the tool kit to obtain a repaired first preset text. Specifically, the text repairing tool comprises a text variable identifying tool, a variable judging tool and an eliminating tool, and in the process of converting the word document in the preset format into the first preset text, the variable in the word document needs to be converted into the variable of the EL expression, so that the situation of line division is easy to occur when the variable in the word document is transferred to the first preset text, and the text repairing tool can be used for repairing the problem of line division of the variable in the first preset text. Wherein, the variable in the word document can be an asset number, a company name, and the like.
In one embodiment, as shown in FIG. 3, step S130a includes sub-steps S130aa, S130ab and S130 ac.
S130aa, identifying the variable in the first preset text according to the variable identification tool to obtain the variable in the first preset text.
And identifying the variable in the first preset text according to the variable identification tool to acquire the variable in the first preset text. Specifically, the variable identification tool identifies a variable in the first preset text to judge whether the variable exists in the first preset text, so as to obtain the variable in the first preset text. The variable identification tool can identify the variables such as the asset number and the company name in the first preset text.
S130ab, judging the variables in the first preset text according to the variable judgment tool to obtain whether the lines are divided at the variables in the first preset text.
And judging the variables in the first preset text according to the variable judgment tool to obtain whether the lines exist at the variables in the first preset text. Specifically, the variable determination tool determines whether a branch line exists at a variable position in the first preset text, and if a problem of a branch line occurs at the variable position in the first preset text, the variable position in the first preset text can be determined, which can be determined by regular' \\ [ \ S ]? \ { [ \ S ]? \\ judging the variable position in the first preset text to obtain whether the variable position in the first preset text is divided into lines.
S130ac, if the lines exist at the variable positions in the first preset text, removing redundant texts at the variable positions in the first preset text according to the removing tool to obtain the repaired first preset text.
If the lines exist at the variable positions in the first preset text, removing redundant texts at the variable positions in the first preset text according to the removing tool to obtain the repaired first preset text. After the removing tool removes redundant texts at the variable positions in the first preset text, lines generated at the variable positions in the first preset text disappear, and the repaired first preset text is obtained. For example, when the variable in the first preset text is "company asset-enter key-company name", the branch lines at the variable in the first preset text are removed by the removing tool, and the variable in the first preset text is "company asset-company name", so that the variable in the first preset text is a continuous variable.
S140, converting the format of the first preset text according to a second format conversion tool in the tool kit to generate a second preset text.
And carrying out format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text. Specifically, the second preset text is a text in a freemarker file format, that is, the second preset text is a text in a ftl format, and the first preset text may be a text in an xml format, a text in an xhtml format, or a text in a tex format.
In another embodiment, step S140 is followed by step S140 a.
S140a, classifying the second preset text according to the classification tools in the tool kit to obtain a classified second preset text.
And classifying the second preset text according to a classification tool in the tool kit to obtain the classified second preset text. Specifically, the classification tool classifies the second preset text according to the content in the second preset text, so as to obtain the classified second preset text. And the classification tool classifies the second preset texts according to a preset sequence, wherein the preset sequence can be the priority level sequence of the second preset texts or the time sequence corresponding to the second preset text generation time, so that a freemarker template is manufactured in batches for word document files input by a user.
S150, formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template.
And formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template. And formatting the second preset text to obtain a freemarker template, namely the manufactured freemarker template, and repeatedly using the freemarker template for multiple times.
The embodiment of the invention provides a method for making a freemarker template, which comprises the steps of receiving a word document submitted by a user, carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format, carrying out format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text, carrying out format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text, and formatting the second preset text according to a formatting tool in the tool kit to generate the freemarker template. By the method, the manufacturing efficiency of the freemarker template is greatly improved, and human errors are reduced.
The embodiment of the invention also provides a device for manufacturing the freemarker template, and the device for manufacturing the freemarker template is used in any embodiment of the method for manufacturing the freemarker template. Specifically, referring to fig. 4, fig. 4 is a schematic block diagram of an apparatus for making a freemarker template according to an embodiment of the present invention. The device for making the freemarker template can be configured in a user terminal.
As shown in fig. 4, the apparatus for making freemarker template includes a word document receiving unit 110, a format processing unit 120, a first text format converting unit 130, a second text format converting unit 140, and a text formatting unit 150.
A word document receiving unit 110, configured to receive a word document submitted by a user.
And the format processing unit 120 is configured to perform format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format.
And carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate the word document in a preset format. Specifically, a project for manufacturing a freemarker template is established in a java development tool, and the toolkit is established in the project, wherein the toolkit can be a jar package required for manufacturing the freemarker template, and the word document is subjected to format processing by calling a format processing tool in the toolkit to generate a word document in a preset format.
In another embodiment, the format processing unit 120 includes a format judging unit 121 and a document format converting unit 122.
And the format judging unit 121 is used for judging the format of the word document according to the format judging tool so as to obtain the format type of the word document.
And judging the format of the word document according to the format judgment tool to obtain the format type of the word document. Specifically, the format judgment tool judges a suffix of the word document to obtain a format type of the word document. For example, if the suffix of the word document submitted by the receiving user is a doc suffix, the word document input by the receiving user is judged to be a doc type file.
And the document format conversion unit 122 is configured to, if the format type of the word document does not conform to the preset format, perform format conversion on the word document according to the format conversion tool to obtain a word document conforming to the preset format.
And if the format type of the word document does not accord with a preset format, carrying out format conversion on the word document according to the format conversion tool so as to obtain the word document which accords with the preset format. Specifically, the format conversion tool may convert a word document with doc suffix into a word document with doc suffix, or may convert a word document with doc suffix into a word document with doc suffix, and the format conversion tool performs format conversion on a word document which does not conform to the preset format according to the preset format. For example, if the preset format is doc format and the format of the word document is docx format, the format of the word document is converted into the word document in doc format by the format conversion tool.
A first text format conversion unit 130, configured to perform format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text.
And performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text. The first format conversion tool is used for converting the word document in the preset format into a first preset text, and the first preset text is a text of a markup language type, so that the first preset text can be a text in an xml format, a text in an xhtml format, and a text in a tex format.
In other embodiments of the present invention, the apparatus 100 for making freemarker template further includes a text repairing unit 130 a.
The text repairing unit 130a is configured to repair the first preset text according to a text repairing tool in the toolkit to obtain a repaired first preset text.
And repairing the first preset text according to a text repairing tool in the tool kit to obtain a repaired first preset text. Specifically, the text repairing tool comprises a text variable identifying tool, a variable judging tool and an eliminating tool, and in the process of converting the word document in the preset format into the first preset text, the variable in the word document needs to be converted into the variable of the EL expression, so that the situation of line division is easy to occur when the variable in the word document is transferred to the first preset text, and the text repairing tool can be used for repairing the problem of line division of the variable in the first preset text. Wherein, the variable in the word document can be an asset number, a company name, and the like.
In another embodiment, the text repairing unit 130a includes a text variable recognizing unit 130aa, a text variable judging unit 130ab, and a text rejecting unit 130 ac.
A text variable recognition unit 130aa, configured to recognize a variable in the first preset text according to the variable recognition tool to obtain the variable in the first preset text.
And identifying the variable in the first preset text according to the variable identification tool to acquire the variable in the first preset text. Specifically, the variable identification tool identifies a variable in the first preset text to judge whether the variable exists in the first preset text, so as to obtain the variable in the first preset text. The variable identification tool can identify the variables such as the asset number and the company name in the first preset text.
The text variable judgment unit 130ab is configured to judge, according to the variable judgment tool, a variable in the first preset text to obtain whether a line segment exists at the variable in the first preset text.
And judging the variables in the first preset text according to the variable judgment tool to obtain whether the lines exist at the variables in the first preset text. Specifically, the variable determination tool determines whether a branch line exists at a variable position in the first preset text, and if a problem of a branch line occurs at the variable position in the first preset text, the variable position in the first preset text can be determined, which can be determined by regular' \\ [ \ S ]? \ { [ \ S ]? \\ judging the variable position in the first preset text to obtain whether the variable position in the first preset text is divided into lines.
The text removing unit 130ac is configured to remove, according to the removing tool, redundant texts at the variable positions in the first preset text to obtain the repaired first preset text if the variable positions in the first preset text have lines.
If the lines exist at the variable positions in the first preset text, removing redundant texts at the variable positions in the first preset text according to the removing tool to obtain the repaired first preset text. After the removing tool removes redundant texts at the variable positions in the first preset text, lines generated at the variable positions in the first preset text disappear, and the repaired first preset text is obtained. For example, when the variable in the first preset text is "company asset-enter key-company name", the branch lines at the variable in the first preset text are removed by the removing tool, and the variable in the first preset text is "company asset-company name", so that the variable in the first preset text is a continuous variable.
The second text format conversion unit 140 is configured to perform format conversion on the first preset text according to a second format conversion tool in the toolkit to generate a second preset text.
And carrying out format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text. Specifically, the second preset text is a text in a freemarker file format, that is, the second preset text is a text in a ftl format, and the first preset text may be a text in an xml format, a text in an xhtml format, or a text in a tex format.
In other embodiments of the present invention, the apparatus 100 for making freemarker template further includes a text classification unit 140 a.
The text classification unit 140a is configured to classify the second preset text according to a classification tool in the tool kit, so as to obtain a classified second preset text.
And classifying the second preset text according to a classification tool in the tool kit to obtain the classified second preset text. Specifically, the classification tool classifies the second preset text according to the content in the second preset text, so as to obtain the classified second preset text. The classification tool classifies the second preset texts according to a preset sequence, wherein the preset sequence can be the priority level sequence of the second preset texts or the time sequence corresponding to the second preset text generation time, so that a freemarker template is manufactured in batches for word document files input by a user
A text formatting unit 150, configured to format the second preset text according to a formatting tool in the toolkit to generate a freemarker template.
And formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template. And formatting the second preset text to obtain a freemarker template, namely the manufactured freemarker template, and repeatedly using the freemarker template for multiple times.
The device for making the freemarker template provided by the embodiment of the invention is used for executing the method for making the freemarker template, if a word document submitted by a user is received, the word document is subjected to format processing according to a format processing tool in a preset tool kit to generate a word document in a preset format, the word document in the preset format is subjected to format conversion according to a first format conversion tool in the tool kit to generate a first preset text, the first preset text is subjected to format conversion according to a second format conversion tool in the tool kit to generate a second preset text, and the second preset text is formatted according to a formatting tool in the tool kit to generate the freemarker template. By the method, the manufacturing efficiency of the freemarker template is greatly improved, and human errors are reduced.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Referring to fig. 5, the device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032, when executed, may cause the processor 502 to perform a method of business processing.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute the method of business processing.
The network interface 505 is used for network communication, such as providing transmission of data information. It will be appreciated by those skilled in the art that the configuration shown in fig. 5 is a block diagram of only a portion of the configuration associated with the inventive arrangements and does not constitute a limitation of the device 500 to which the inventive arrangements may be applied, and that a particular device 500 may include more or less components than those shown, or some components may be combined, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following functions: receiving a word document submitted by a user; carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format; performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text; performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text; and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template.
Those skilled in the art will appreciate that the embodiment of the apparatus 500 illustrated in fig. 5 does not constitute a limitation on the specific construction of the apparatus 500, and in other embodiments, the apparatus 500 may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the apparatus 500 may only include the memory and the processor 502, and in such embodiments, the structure and function of the memory and the processor 502 are the same as those of the embodiment shown in fig. 5, and are not repeated herein.
It should be understood that in the present embodiment, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors 502, a Digital Signal Processor 502 (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general-purpose processor 502 may be a microprocessor 502 or the processor 502 may be any conventional processor 502 or the like.
In another embodiment of the present invention, a computer storage medium is provided. The storage medium may be a non-volatile computer-readable storage medium. The storage medium stores a computer program 5032, wherein the computer program 5032 when executed by the processor 502 performs the steps of: receiving a word document submitted by a user; carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format; performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text; performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text; and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a device 500 (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method of making a freemarker template, comprising:
receiving a word document submitted by a user;
carrying out format processing on the word document according to a format processing tool in a preset tool kit to generate a word document in a preset format;
performing format conversion on the word document in the preset format according to a first format conversion tool in the tool kit to generate a first preset text;
performing format conversion on the first preset text according to a second format conversion tool in the tool kit to generate a second preset text;
and formatting the second preset text according to a formatting tool in the tool kit to generate a freemarker template.
2. The method of making a freemarker template according to claim 1, wherein the format processing tool includes a format determination tool and a format conversion tool, and the processing of the format of the word document according to the format processing tool in a preset toolkit to generate a word document in a preset format includes:
judging the format of the word document according to the format judgment tool to obtain the format type of the word document;
and if the format type of the word document does not accord with a preset format, carrying out format conversion on the word document according to the format conversion tool so as to obtain the word document which accords with the preset format.
3. A method of making a freemarker template according to claim 1, further comprising, after said format converting the word document in the preset format to generate a first preset text according to a first format conversion tool in the toolkit:
and repairing the first preset text according to a text repairing tool in the tool kit to obtain a repaired first preset text.
4. The method of making a freemarker template according to claim 3, wherein the text restoration tool includes a variable identification tool, a variable judgment tool and a removal tool, and the restoring the first preset text according to the text restoration tool in the toolkit to obtain a restored first preset text includes:
identifying variables in the first preset text according to the variable identification tool to obtain the variables in the first preset text;
judging the variables in the first preset text according to the variable judgment tool to obtain whether the lines exist at the variables in the first preset text;
if the lines exist at the variable positions in the first preset text, removing redundant texts at the variable positions in the first preset text according to the removing tool to obtain the repaired first preset text.
5. A method of fabricating a freemarker template according to claim 1, further comprising, after said formatting said first predetermined text according to a second format conversion tool in said toolkit to generate a second predetermined text:
and classifying the second preset text according to a classification tool in the tool kit to obtain the classified second preset text.
6. An apparatus for fabricating a freemarker template, comprising:
the word document receiving unit is used for receiving a word document submitted by a user;
the format processing unit is used for carrying out format processing on the word document according to a format processing tool in a preset tool kit so as to generate a word document in a preset format;
the first text format conversion unit is used for carrying out format conversion on the word document in the preset format according to a first format conversion tool in the tool kit so as to generate a first preset text;
the second text format conversion unit is used for carrying out format conversion on the first preset text according to a second format conversion tool in the tool kit so as to generate a second preset text;
and the text formatting unit is used for formatting the second preset text according to a formatting tool in the tool kit so as to generate a freemarker template.
7. An apparatus for fabricating a freemarker template according to claim 6, wherein said format processing unit includes:
the format judging unit is used for judging the format of the word document according to the format judging tool so as to obtain the format type of the word document;
and the document format conversion unit is used for converting the format of the word document according to the format conversion tool if the format type of the word document does not conform to the preset format so as to obtain the word document conforming to the preset format.
8. An apparatus for fabricating a freemarker template according to claim 6, further comprising:
and the text classification unit is used for classifying the second preset text according to the classification tools in the tool kit to obtain the classified second preset text.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements a method of fabricating a freemarker template as claimed in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, causes the processor to carry out the method of producing a freemarker template according to any one of claims 1 to 5.
CN201911282643.9A 2019-12-13 2019-12-13 Method, device, computer equipment and storage medium for making freemaker template Active CN111046635B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911282643.9A CN111046635B (en) 2019-12-13 2019-12-13 Method, device, computer equipment and storage medium for making freemaker template

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911282643.9A CN111046635B (en) 2019-12-13 2019-12-13 Method, device, computer equipment and storage medium for making freemaker template

Publications (2)

Publication Number Publication Date
CN111046635A true CN111046635A (en) 2020-04-21
CN111046635B CN111046635B (en) 2023-09-29

Family

ID=70236116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911282643.9A Active CN111046635B (en) 2019-12-13 2019-12-13 Method, device, computer equipment and storage medium for making freemaker template

Country Status (1)

Country Link
CN (1) CN111046635B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378535A (en) * 2021-06-23 2021-09-10 浪潮软件科技有限公司 Method and system for generating docx format document based on freemarker

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228777A (en) * 2017-12-28 2018-06-29 北京洪泰同创信息技术有限公司 Html text exports to the method and device of word document
CN109933752A (en) * 2017-12-15 2019-06-25 北京京东尚科信息技术有限公司 A kind of method and apparatus exporting electronic document

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933752A (en) * 2017-12-15 2019-06-25 北京京东尚科信息技术有限公司 A kind of method and apparatus exporting electronic document
CN108228777A (en) * 2017-12-28 2018-06-29 北京洪泰同创信息技术有限公司 Html text exports to the method and device of word document

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378535A (en) * 2021-06-23 2021-09-10 浪潮软件科技有限公司 Method and system for generating docx format document based on freemarker

Also Published As

Publication number Publication date
CN111046635B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN111639473A (en) Excel file analysis method and device based on java, computer equipment and storage medium
WO2020119064A1 (en) Method and device for storing internet information in linked manner, computer apparatus and storage medium
CN107516534A (en) A kind of comparison method of voice messaging, device and terminal device
US11727701B2 (en) Techniques to determine document recognition errors
CN108921552A (en) A kind of method and device of experimental evidence
CN111240688A (en) excel file analysis method and device, computer equipment and storage medium
CN111046635A (en) Method and device for manufacturing freemarker template, computer equipment and storage medium
CN116860350A (en) Jailhouse tool configuration method, electronic device and computer readable storage medium
CN111445319A (en) Voucher generation method and device, computer equipment and storage medium
CA2734207A1 (en) Electronic file comparator
CN107193249A (en) Program development servicing unit and program development householder method
US8930939B2 (en) Comparing system engram with product engram to determine compatibility of product with system
CN112115105A (en) Service processing method, device and equipment
CN106325849B (en) Data processing method and data processing device
CN111695327B (en) Method and device for repairing messy codes, electronic equipment and readable storage medium
CN103761247B (en) A kind of processing method and processing device of error file
CN113626420A (en) Data preprocessing method and device and readable storage medium
US8495033B2 (en) Data processing
CN110727537A (en) Method and device for uniformly processing response message, computer equipment and storage medium
CN110852083A (en) Method and device for generating short message template
CN115729530B (en) Cross-system logic statement generation method, device, storage medium and equipment
CN110874522B (en) File format conversion method and device, electronic equipment and storage medium
CN110347984B (en) Policy page changing method and device, computer equipment and storage medium
CN116089363B (en) Data processing method, device, electronic equipment and storage medium
CN110705216A (en) Method and device for converting docx file into xml file based on java and computer equipment

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
GR01 Patent grant
GR01 Patent grant