Electronic device, method, and non-transitory computer-readable storage medium for adjusting arrangement of contents of electronic document
The electronic device adjusts document layout to accommodate translated text by using blank areas, addressing readability issues and enhancing user experience by preventing overlap, thus maintaining document clarity.
Patent Information
- Application Number
- PCT/KR2025/006745
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-09-04
- Filing Date
- 2025-05-19
- Publication Date
- 2026-01-08
AI Technical Summary
Existing electronic document viewers struggle to maintain readability and user experience when translating text due to differences in character length and writing rules between languages, often causing translated text to overlap or obscure original content.
The electronic device adjusts the layout and arrangement of the document by identifying blank areas and expanding the area for translated text, ensuring it does not overlap with other content, using a processor to execute translation and layout algorithms that consider text size, style, and adjacent content.
Maintains readability and user experience by naturally arranging translated text, preventing overlap and improving usability post-translation.
Smart Images

Figure KR2025006745_08012026_PF_FP_ABST
Abstract
Description
Electronic device, method, and non-transitory computer-readable storage medium for controlling the arrangement of content in an electronic document
[0001] The present disclosure relates to an electronic device, a method, and a non-transitory computer-readable storage medium for controlling the arrangement of content in an electronic document (e.g., an electronic document based on portable document format (PDF) and / or a file including the electronic document).
[0002] An electronic document is described as a document in electronic form (e.g., a file and / or a bitstream transmitted over a network). For example, an electronic document based on text, graphics, images, fonts, or a combination thereof may be stored within a file based on a standard related to the portable document format (PDF) (e.g., the International Standard Organization (ISO) 32000). An electronic device running a software application for electronic documents (e.g., an electronic document viewer) can identify text, graphics, and / or images, each occupying a portion of the electronic document, from the file. The electronic device can display the text, graphics, and / or images on a display having a layout represented by the electronic document.
[0003] The above information may be provided as background information to aid in understanding the present disclosure. None of the above is claimed to be prior art related to the present disclosure or can be used in making decisions related to prior art.
[0004] According to one embodiment, an electronic device may include a display, a memory including one or more storage media and storing instructions, and at least one processor including a processing circuit. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to receive an input for translating a first text in a first language contained in a first area within an electronic document. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to obtain a second text in a second language translated from the first text based on the input. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to identify a size of an area within the electronic document for displaying the second text. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to identify a size of the first area within the electronic document, and a second area within the electronic document, the second area including a first blank area within the electronic document, adjacent to the first area along a vertical direction of the electronic document, based on a size of the area that is greater than a size of the first area within the electronic document. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the electronic document including the second text in the second area including the first area and the first blank area.The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along a horizontal direction of the electronic document, based on the size of the area being greater than the size of the second area.
[0005] In one embodiment, a non-transitory computer-readable storage medium storing instructions may be provided. The instructions, when executed by an electronic device including a display, may cause the electronic device to receive an input for translating a first text in a first language contained in a first area within an electronic document. The instructions, when executed by the electronic device, may cause the electronic device to obtain a second text in a second language translated from the first text based on the input. The instructions, when executed by the electronic device, may cause the electronic device to identify a size of an area within the electronic document for displaying the second text. The instructions, when executed by the electronic device, may cause the electronic device to identify a size of the first area within the electronic document, based on a size of the area that is greater than a size of the first area within the electronic document, and a size of a second area within the electronic document, the second area including a first blank area within the electronic document, adjacent to the first area along a vertical direction of the electronic document. The instructions, when executed by the electronic device, may cause the electronic device to display the electronic document including the second text in the second area, including the first area and the first blank area, based on a size of the area that is less than the size of the second area. The instructions, when executed by the electronic device, may cause the electronic device to display the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document, adjacent to the first area along a horizontal direction of the electronic document, based on a size of the area that is greater than the size of the second area.
[0006] In one embodiment, a method of an electronic device including a display may be provided. The method may include receiving an input for translating a first text in a first language, the first text included in a first area within an electronic document. The method may include obtaining a second text in a second language, translated from the first text, based on the input. The method may include identifying a size of an area within the electronic document for displaying the second text. The method may include identifying a size of a second area within the electronic document, the second area including the first area within the electronic document and a first blank area within the electronic document adjacent to the first area along a vertical direction of the electronic document, based on a size of the area being larger than a size of the first area within the electronic document. The method may include displaying the electronic document including the second text in the second area, the second area including the first area and the blank area, based on a size of the area being smaller than the size of the second area. The method may include an operation of displaying the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along a horizontal direction of the electronic document, based on the size of the area being greater than the size of the second area.
[0007] FIG. 1 illustrates one embodiment of an electronic device that performs translation on an electronic document.
[0008] FIG. 2 illustrates a schematic block diagram of an electronic device according to one embodiment.
[0009] FIG. 3 illustrates a flowchart of the operation of an electronic device for determining an area of an electronic document in which text obtained by executing a translation function is to be displayed.
[0010] FIG. 4 illustrates an exemplary operation of an electronic device that executes a translation function using objects representing text of an electronic document.
[0011] Figure 5 illustrates a flowchart of the operation of an electronic device that executes a layout algorithm for displaying text.
[0012] Figure 6 illustrates a flowchart of the operation of an electronic device for determining an area of text within an electronic document using a blank area.
[0013] Figures 7a and 7b illustrate exemplary operations of an electronic device for detecting a blank area adjacent to an area within an electronic document where text is displayed.
[0014] Figure 8 illustrates a flowchart of the operation of an electronic device for changing the style of text.
[0015] FIG. 9 illustrates an exemplary operation of an electronic device for changing the style of exemplary text in an electronic document.
[0016] FIG. 10 illustrates an exemplary operation of an electronic device based on other content of an electronic document adjacent to text.
[0017] FIG. 11 illustrates a flowchart of the operation of an electronic device for at least partially changing the content of a page containing text.
[0018] FIG. 12 illustrates an exemplary operation of an electronic device that at least partially changes the content of a page containing text.
[0019] FIG. 13 illustrates an exemplary operation of an electronic device to display an electronic document that was displayed prior to executing a translation function, based on user input.
[0020] FIG. 14 is a block diagram of an electronic device within a network environment according to various embodiments.
[0021] Hereinafter, various embodiments of this document are described with reference to the attached drawings.
[0022] The various embodiments of this document and the terminology used therein are not intended to limit the technology described in this document to a specific embodiment, but should be understood to include various modifications, equivalents, and / or substitutes of the embodiment. In connection with the description of the drawings, similar reference numerals may be used for similar components. The singular expression may include plural expressions unless the context clearly indicates otherwise. In this document, expressions such as "A or B", "at least one of A and / or B", "A, B, or C", or "at least one of A, B, and / or C" may include all possible combinations of the items listed together. Expressions such as "first", "second", "first", or "second" may modify the corresponding components regardless of order or importance, and are only used to distinguish one component from another, but do not limit the corresponding components. When it is said that a component (e.g., a first component) is “(functionally or communicatively) connected” or “connected” to another component (e.g., a second component), said component may be directly connected to said other component, or may be connected via another component (e.g., a third component).
[0023] FIG. 1 illustrates an embodiment of an electronic device (101) that performs translation on an electronic document (130). The electronic device (101) can control a display (110) to display at least a portion of the electronic document (130). An exemplary hardware configuration included in the electronic device (101) is described with reference to FIG. 2.
[0024] Referring to FIG. 1, an exemplary state of an electronic device (101) displaying an electronic document (130) is illustrated. The electronic device (101) may display at least a portion of the electronic document (130) on at least a portion of the display (110). For example, the electronic device (101) may display at least a portion of the electronic document (130) on the display (110) in response to an input for opening, executing, or viewing the electronic document (130) and / or a file representing the electronic document (130) (e.g., file (280) of FIG. 2). The electronic device (101) may display at least a portion of the electronic document (130) by executing a software application for displaying the electronic document (130) (hereinafter, referred to as an electronic document viewer and / or viewer application). For example, the electronic document (130) may be stored as a file in the memory of the electronic device (101). For example, the electronic document (130) may be stored in an external electronic device (e.g., a server) connected to the electronic device (101) via a network. The electronic device (101) may obtain a bitstream representing at least a portion of the electronic document (130) from the external electronic device. For example, the electronic document (130) may be in the form of a file stored in the electronic device (101) and / or a bitstream transmitted to the electronic device (101) via a network.
[0025] Referring to FIG. 1, the electronic device (101) may display a user interface (UI) based on a viewer application on a display (110). The electronic device (101) may display a title bar and / or a status bar on a first portion (121) of a display area including the top of the display (110). The title bar may display a name of an electronic document (130) (e.g., “A_doc”). The status bar may display icons indicating the status of the electronic device (101), such as the state of charge (SOC) of the battery, the current time, and / or a WiFi connection.
[0026] Referring to FIG. 1, the electronic device (101) can display at least a portion of an electronic document (130) on a second portion (122) on a display (110). Although the second portion (122) is illustrated as being positioned below the first portion (121), the positional relationship between the portions (121, 122) is not limited to the embodiment. The second portion (122) can be referred to as a browser portion of a viewer application. Through the second portion (122), the electronic device (101) can display at least a portion of the content of the electronic document (130) including the first text (131). In response to a touch gesture performed on the second portion (122) (e.g., a drag gesture and / or a swipe gesture based on contact between two fingers), the electronic device (101) may change or replace a portion of the electronic document (130) displayed through the second portion (122) with another portion (e.g., a scroll). In response to another touch gesture performed on the second portion (122) (e.g., a pinch-to-zoom gesture based on contact between two fingers), the electronic device (101) may zoom in or out of the electronic document (130) displayed through the second portion (122).
[0027] Referring to FIG. 1, the electronic device (101) can display executable objects, each corresponding to a function for editing an electronic document (130), on a third portion (123) on the display (110). Although the third portion (123) is illustrated as being positioned below the second portion (122), the positional relationship between the portions (122, 123) is not limited to the embodiment. For example, the third portion (123) can be overlapped on the second portion (122) in the form of a pop-up window. For example, the third portion (123) can be conditionally displayed based on a user input.
[0028] For example, the executable objects displayed through the third portion (123) may each correspond to a function for adding text entered via a software keyboard (or a virtual keyboard, or a physical keyboard paired with the electronic device (101)) to the electronic document (130), a function for adding at least one stroke having a shape similar to a pen drawing of a ballpoint pen on the electronic document, a function for adding at least one stroke having a shape similar to a pen drawing of a liner on the electronic document (130), a function for removing one or more strokes added to the electronic document (130) (e.g., strokes representing hand-writing and / or hand-drawing), a function for selecting strokes added to the electronic document (130) (e.g., a lasso function), a function for identifying texts having a particular font from a plurality of strokes, and / or a function for at least partially undoing editing actions applied to the electronic document (130).
[0029] Referring to FIG. 1, the electronic device (101) may display executable objects for changing or replacing a screen (e.g., a screen including parts (121, 122, 123) and based on the execution of a viewer application) being displayed through the display (110) on a fourth portion (124) on the display (110) with another screen. The executable objects displayed through the fourth portion (124) may each correspond to a function for displaying another screen that was displayed before the screen being displayed through the display (110) within the state of FIG. 1 (e.g., a back function), a function for displaying a designated screen referred to as a launcher screen (or home screen) (e.g., a home function), and / or a function for displaying a list of one or more screens that were displayed on the display (110) (or executed by the electronic device (101).
[0030] Referring to FIG. 1, an exemplary state of an electronic device (101) displaying a first text (131) in a first language (e.g., Korean) is illustrated. The electronic device (101) may receive a first input for translating the first text (131). For example, the electronic device (101) may receive an input for selecting the first text (131).
[0031] For example, an input for selecting a first text (131) may be detected based on a drag gesture performed over a portion of the display (110) on which the first text (131) is displayed. The drag gesture may be detected based on a path or trajectory of a finger on the display (110) that wraps around the first text (131) and / or is dragged along a direction (e.g., horizontal direction) in which the first text (131) is displayed. The input may be detected based on a tap gesture (or double tap gesture, or a long-touch gesture, detected based on a finger remaining in contact with the display (110) for more than a specified time, such as 1.5 seconds) performed over a portion of the display (110) on which the first text (131) is displayed. The input may include an input indicating a selection of an executable object displayed on the display (110) (e.g., a visual object for executing a translation function for the entire electronic document (130) and / or a portion (e.g., a paragraph) of the electronic document (130). The input may be detected based on an audio signal including an utterance indicating a translation of the first text (131) (e.g., “Translate the text displayed on the screen”). The audio signal may further include, together with the utterance, a reserved word (or spot keyword) for voice processing of the electronic device (101) (e.g., “Hey Bixby”).
[0032] Referring to FIG. 1, an electronic device (101) that receives an input for translating a first text (131) may display a pop-up menu (140) for receiving setting values related to the translation. The pop-up menu (140) may be displayed on a point on the display (110) that received the input (e.g., a point corresponding to a position of a finger that was in contact with the display (110) to perform a tap gesture) and / or on another point on the display (110) adjacent to the point. The shape, size, and / or location at which the pop-up menu (140) is displayed are not limited to the above-described locations.
[0033] Referring to FIG. 1, the electronic device (101) may obtain or display information required to translate the first text (131) (or all texts included in the electronic document (130)) through a pop-up menu (140). The information may include a first language (or source language) of the first text (131) to be translated by a translation service provided by the electronic device (101), and a language (e.g., target language) of another text to be provided as a result of the translation service. In one embodiment, the electronic device (101) may (automatically) detect or determine the first language (e.g., Korean) of the first text (131). The electronic device (101) may receive an input for changing the source language and / or target language through the pop-up menu (140).
[0034] Referring to FIG. 1, an exemplary operation of an electronic device (101) performing translation from Korean to English is illustrated. The electronic device (101) may display text (e.g., "Korean → English") within a pop-up menu (140) indicating that translation from Korean to English is performed. The electronic device (101) may display an icon (e.g., an icon including a shape in the shape of an "x") for stopping the display of the pop-up menu (140) along with the text within the pop-up menu (140). Based on an input selecting the icon, the electronic device (101) may at least temporarily stop displaying the pop-up menu (140). In one embodiment, the electronic device (101) may stop translating the first text (131) based on the input. If the above input is received after the completion of the translation of the first text (131), the electronic device (101) can hide the pop-up menu (140) from the display (110) and stop displaying the translation result of the first text (131) on the display (110).
[0035] Referring to FIG. 1, based on an input for translating a first text (131) in a first language, the electronic device (101) may obtain a second text (150) in a second language, translated from the first text (131) in the first language. The operation of translating the first text (131) (or the translation function for the first text (131)) may include an operation of generating and / or obtaining a second text (150) that includes characters, words, and / or sentences defined by a second language different from the first language of the first text (131), while maintaining the content of the first text (131) (e.g., context, contextual meaning, intent, and / or semantic representation). For example, the second text (150) in the second language may have the contextual meaning of the first text (131) in the first language. An exemplary operation of an electronic device (101) to at least partially translate texts contained in an electronic document (130) is described with reference to FIG. 4.
[0036] Referring to FIG. 1, an exemplary state of an electronic device (101) is illustrated that receives an input for translation of a first text (131) in a first language (e.g., Korean) (e.g., “If the tray separator plate is not used so that it is perpendicular to the groove of the tray, the product may be damaged.”) contained within (or positioned on) an area having an exemplary width w1 and height h1. Based on the input received, for example, through a pop-up menu (140), the electronic device (101) may obtain a second text (151) in a second language (e.g., English) translated from the first text (e.g., “Ensure that the ejection pin is perpendicular to the hole. Otherwise, the device may be damaged.”). Because the first and second languages have different characters and / or writing rules, the first text (131) in the first language and the second text (151) translated from the first text (131) may have different lengths, even though they have the same meaning. For example, the length of the second text (151) may be shorter than the length of the first text (131). For example, the length of the second text (151) may be longer than the length of the first text (131).
[0037] Referring to FIG. 1, an embodiment of obtaining a second text (151) of a second language, which has a length longer than the length of the first text (131) of a first language, is illustrated. The number of characters included in the second text (151) of the second language may be greater than the number of characters included in the first text (131) of the first language. The second text (151) having a length longer than the length of the first text (131) may occupy a wider area of the electronic document (130) than the area occupied by the first text (131) in order to display the second text (151).
[0038] According to one embodiment, the electronic device (101) may identify the size of an area for displaying second text (151) within an electronic document (130). Referring to FIG. 1, the first text (131) may be displayed through an area having a width w1 and a height h1 within the electronic document (130). Meanwhile, the second text (151) may be displayed through an area having a width w2 greater than the width w1 of the area for displaying the first text (131) and a height h2 greater than the height h1 of the area for displaying the first text (131). The electronic device (101) may predict or measure the size of an area of the electronic document (130) for displaying the second text (151) before performing an operation for displaying the electronic document (130) (e.g., rendering the electronic document (130).
[0039] In one embodiment, based on the size of an area for displaying second text (151) that is larger than the size of a first area within an electronic document (130) including first text (131), the electronic device (101) may identify the first area within the electronic document (130) and a blank area within the electronic document (130) adjacent to the first area within the electronic document (130). In the present disclosure, a blank area may refer to an area within the electronic document (130) where no content (e.g., an image, text, and / or a table) is positioned. The electronic device (101) may identify the size of the first area and a second area including the blank area. When the size of the second area is smaller than the size of the area measured for displaying the second text (151), the electronic device (101) may display the electronic document (130) including the second text (151) in the second area.
[0040] Referring to the exemplary electronic document (130) of FIG. 1, the electronic device (101) can identify or check a blank area (or margin area or padding area) adjacent to the electronic document (130) in which the first text (131) is placed. The electronic device (101) can display the second text (151) in the first area where the first text (131) was displayed and in the blank area adjacent to the first area. For example, the area of the electronic document in which the second text (151) is displayed can have a shape such that the first area is expanded horizontally or vertically toward the blank area.
[0041] For example, when the size of an area for displaying text within an electronic document (130) is increased by a translation function, the readability of the content of the electronic document (130) may be reduced. For example, the translated text may overlap with other content or obscure other content.
[0042] As described above, according to one embodiment, the electronic device (101) can change or adjust the arrangement, layout, and / or form of the content of the electronic document (130) based on the size of the translated text, in order to maintain the readability of the electronic document (130) independently from the execution of the translation function. An exemplary operation of the electronic device (101) for determining whether the readability of the electronic document (130) is reduced by the translation function is described with reference to FIG. 3. By displaying the content of the electronic document (130) according to the changed arrangement, the electronic device (101) can display the electronic document (130) in which the translated text is naturally arranged. An exemplary operation of the electronic device (101) for generating or displaying the electronic document (130) in which the translated text is naturally arranged is described with reference to FIGS. 5 to 12. For example, within an electronic document (130), translated text may not overlap with other content, or may be spaced apart from other content. By displaying an electronic document (130) in which the translated text is naturally arranged, the electronic device (101) may improve the user experience associated with the electronic document (130), or maintain the user experience and / or usability of the electronic document (130) prior to executing the translation function. An embodiment of an electronic device (101) that supports switching between text prior to executing the translation function (e.g., original text) and text obtained by executing the translation function (e.g., translated text) is described with reference to FIG. 13 .
[0043] Hereinafter, with reference to FIG. 2, an exemplary hardware configuration of an electronic device (101) according to one embodiment and one or more programs executed based on the hardware configuration are described.
[0044] FIG. 2 illustrates a schematic block diagram of an electronic device (101) according to one embodiment. The electronic device (101) of FIG. 2 may include the electronic device (101) of FIG. 1. Referring to FIG. 2, the electronic device (101) may be one of various forms of electronic devices, such as a laptop PC (personal computer) (290), smartphones (291) having various form factors (e.g., a bar-type smartphone (291-1), a foldable-type smartphone (291-2), or a sliderable (or rollable) type smartphone (291-3) having the appearance of the electronic device (101) of FIG. 1), a tablet PC (292), a head-mounted display (HMD) (or head-wearable device) device (293), a watch (294), and other similar computing devices (not shown).
[0045] In one embodiment, the electronic device (101) may be referred to as a mobile device, a user equipment (UE) (or user terminal), a multi-function device, a portable communication device, a portable device, or a server. The form factor of the electronic device (101) is not limited to the exemplary form factors illustrated in FIG. 2. For example, the electronic device (101) may be included as an electronic control unit (ECU) in a vehicle (e.g., an electric vehicle (EV)). For example, the electronic device (101) may include a projector for projecting light to the outside. For example, the electronic device (101) may have any suitable form for outputting an electronic document (e.g., the electronic document 130 of FIG. 1). For example, the electronic device (101) may include a printer that outputs ink (or toner) so that the electronic document can be drawn on a surface of an object such as paper. In the present disclosure, the operation of an electronic device (101) displaying an electronic document may include an operation of visualizing the electronic document through a display (110), as well as an operation of outputting at least a portion of the electronic document on a surface of an external object.
[0046] Referring to FIG. 2, according to one embodiment, an electronic device (101) may include a processor (210) and / or a memory (220). The electronic device (101) may further include a display (110). The processor (210) may be electrically and / or operatively coupled with the memory (220) and / or the display (110). Electrical coupling of the electronic components may include a state in which a wired signal path (or a connection for wireless communication) for transmitting signals is established between the electronic components. Operationally coupling of the electronic components may include a state in which the electronic components are directly coupled (or a state in which the electronic components are indirectly coupled) such that one of the electronic components controls another electronic component. Referring to FIG. 2, an electrical connection between the processor (210), the memory (220), and the display (110) based on electronic components, referred to as a communication bus (202), is schematically illustrated. Through a communication bus (202), the processor (210), memory (220), and display (110) can be communicatively coupled.
[0047] Referring to FIG. 2, a processor (210) of an electronic device (101) may include circuits (e.g., processing circuits and / or cores) for performing operations (e.g., arithmetic operations and / or logical operations) on data. Binary codes (e.g., instructions) representing the operations may be input to the processor (210). The processor (210) may include a central processing unit (CPU), a graphic processing unit (GPU), and / or a neural processing unit (NPU). The processor (210) may be referred to as an application processor (AP) and / or a system on a chip (SoC). The processor (210) may have a structure (e.g., a multi-core structure based on a combination of multiple core circuits such as a dual core, a quad core, a hexa core, or an octa core) for loading (or fetching) and / or executing multiple instructions simultaneously. Within an electronic device (101) comprising at least one processor, including a processor (210), the at least one processor may individually or collectively perform the operations of the present disclosure. For example, the at least one processor may individually and / or collectively perform the operations of FIG. 3, FIG. 5, FIG. 6, FIG. 8, FIG. 11, and / or FIG. 13 by executing instructions stored in the memory (220).
[0048] The memory (220) of FIG. 2 may include a circuit for storing data (or instructions) input to or output from the processor (210). The memory (220) may include volatile memory, such as random-access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM). The non-volatile memory may be referred to as storage. The volatile memory may include, for example, at least one of dynamic RAM (DRAM), static RAM (SRAM), cache RAM, and pseudo SRAM (PSRAM). The non-volatile memory may include, for example, at least one of programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, hard disk, compact disc, solid state drive (SSD), and embedded multimedia card (eMMC). The memory (220) may include one or more storage media (e.g., the volatile memory and / or non-volatile memory described above) located in a distributed manner in the electronic device (101). The processor (210) of the electronic device (101) may execute instructions of the memory (220) within the electronic device (101) to perform functions and / or operations indicated by the instructions (e.g., the operations of FIGS. 3, 5, 6, 8, 11, and / or 13).
[0049] The display (110) of the electronic device (101) may include a circuit for visualizing information provided from the processor (210). The display (110) may include a liquid crystal display (LCD), a plasma display panel (PDP), and / or light emitting diodes (LEDs). The LEDs may include organic LEDs (OLEDs). The embodiment is not limited thereto, and the display (110) may include electronic paper. The display area (or active area) of the display (110) may include an area where light is emitted, formed by pixels (e.g., activated pixels) of the display (110). The display (110) may include a sensor (e.g., a touch sensor) for detecting an external object (e.g., a user's finger) on the display (110). The sensor may be included in the display (110) in the form of a panel (e.g., a touch sensor panel (TSP)).
[0050] Referring to FIG. 2, programs (e.g., a viewer application (260) and / or an electronic document library (250)) are illustrated that are executed by a processor (210) to create or read a file (280) representing an electronic document. The programs may be independently installed in memory (220) (e.g., a collection of instructions and resources, referred to as a package) or may be stored in memory (220) as sub-routines of a single program (or an applet or a dynamic link library (DLL)).
[0051] For example, a processor (210) executing a viewer application (260) may display a UI (e.g., the UI illustrated in FIG. 1) of the viewer application (260), including at least a portion of an electronic document represented by a file (280), on a display (110). The processor (210) may execute the viewer application (260) in response to an input for opening and / or browsing the file (280). The processor (210) executing the viewer application (260) may execute a rendering engine (251) included in an electronic document library (250) so that at least a portion of the electronic document (e.g., a portion corresponding to the shape and / or size of the display (110) and / or browser portion) is displayed. The electronic document library (250) may be a set of instructions for executing functions for processing a PDF-based file (280). The electronic document library (250) may be referred to as a PDF solution.
[0052] In one embodiment, the processor (210) executing the rendering engine (251) may store an image (e.g., raster graphics) representing at least a portion of the electronic document in the electronic document view (252) for storing the rendering result of the electronic document. By executing the rendering engine (251), the processor (210) may obtain information (e.g., objects) defined based on PDF from the file (280). Using the obtained information, the processor (210) may render the electronic document.
[0053] In one embodiment, the processor (210) may execute an electronic document manager (253) to control the creation, display, and / or storage of electronic documents (e.g., control the rendering engine (251) and / or the electronic document analyzer (254)). For example, the electronic document manager (253) may be included in the electronic document library (250) as an interface for providing functions of the electronic document library (250). By executing the electronic document manager (253), the processor (210) may control the execution of the rendering engine (251) and / or the electronic document analyzer (254). For example, the processor (210) may execute the electronic document analyzer (254) using data obtained from the rendering engine (251). By executing the electronic document manager (253), the processor (210) can convert or provide the analysis results of the electronic document analyzer (254) into information usable (or readable) by an external device (e.g., a viewer application (260)). For example, the processor (210) can execute the electronic document manager (253) to store (cach) at least a portion of the electronic document in the memory (220) (e.g., volatile memory). Based on the caching of the electronic document, the processor (210) can perform operations related to the electronic document more quickly.
[0054] The processor (210) that identifies the electronic document represented by the file (280) may support a function (e.g., a summary function and / or a translation function) for generating content related to the electronic document. For example, the processor (210) may execute a summary service (261) of the viewer application (260) to obtain a text in which the content of the electronic document is summarized. The operation of summarizing the electronic document may include an operation of generating at least one natural language sentence describing the content. The at least one natural language sentence generated by the operation of summarizing the electronic document may have a length and / or size less than the length and / or size of the content of the electronic document. For example, the processor (210) may execute a translation service (262) of the viewer application (260) to execute a translation function for at least a portion of the content of the electronic document (e.g., the first text (131) of FIG. 1). The processor (210) can identify the range of text to be translated based on the execution of the translation function through a UI (e.g., the UI displayed on the display (110) of FIG. 1) based on the viewer application (260). The processor (210) can execute a translation service (262) using the text of an electronic document included in the range.
[0055] In order to support the summary function and translation function based on the summary service (261) and the translation service (262), respectively, the processor (210) may execute an artificial intelligence model (270). The artificial intelligence model (270) is a computational model designed to simulate human neural activities (e.g., reasoning activities, creative activities, cognitive activities), and may include a program, hardware (e.g., NPU and / or GPU), or any combination thereof for performing calculations represented by the computational model. The artificial intelligence model (270) may be executed independently by the processor (210) and / or the electronic device (101) (e.g., on-device and / or stand-alone). The embodiment is not limited thereto, and the electronic device (101) may communicate with an external electronic device (e.g., a server) configured to execute the artificial intelligence model (270) to execute functions (e.g., summary functions and / or translation functions) based on the artificial intelligence model (270). To communicate with external electronic devices, the electronic device (101) may further include communication circuitry (and / or a modem).
[0056] For example, the processor (210) may execute a translation function based on an artificial intelligence model (270) (or a translation model (272)) based on a user input. For example, the processor (210) may execute a summary function based on an artificial intelligence model (270) (or a summary model (271)) based on another user input. When executing the translation function, the processor (210) may display a translation result (e.g., the second text (150) of FIG. 1) obtained from the translation model (272) on the display (110). The processor (210) may display the translation result on the display (110) based on the execution of the rendering engine (251).
[0057] In one embodiment, the processor (210) may execute a translation model (272) trained to maintain the style of text, such as tags. For example, the style of the text may include at least one of a font size, including width and / or height, a font name, kerning, line spacing, color, bold, underline, subscript, superscript, and / or italic. Embodiments are not limited thereto, and the style of the text may include information about the limitations of the area in which the text can be positioned (e.g., an area limited by a matrix, a cell of a table, and / or a text box), the visibility of the text, and / or the content of an electronic document adjacent to the text (e.g., paths and / or images). An exemplary operation of the processor (210) executing the translation model (272) using a combination of text and tags representing the style of at least a portion of the text is described with reference to FIG. 4. The above text and the above combination of tags can be obtained by executing a tag converter (255).
[0058] In one embodiment, the processor (210) may execute a tag converter (255) to generate information inputtable into the translation model (272) from text included in an electronic document. The information may include tags indicating the style of (at least a portion of) the text, as described above. For example, if the color of a first portion of the text is different from the color of the rest of the text, the processor (210) may obtain, from the tag converter (255), a combination of a tag indicating the color of the first portion and the text. In the above example, if only a second portion of the text further includes an underline, the processor (210) may obtain, from the tag converter (255), a combination of a tag indicating the color of the first portion, another tag indicating that an underline is applied to the second portion, and the text. An example of the combination obtained by the processor (210) executing the tag converter (255) is described with reference to FIG. 4.
[0059] In one embodiment, the information obtained from the translation model (272) may include a second text translated from the first text, and tags indicating the style of at least a portion of the second text. The processor (210) may execute a tag converter (255) to generate or obtain information readable (or parsable) by the rendering engine (251) from a combination of the second text and the tags. Using the information generated by executing the tag converter (255), the processor (210) may display an electronic document including the second text on the display (110).
[0060] According to one embodiment, the processor (210) may execute a viewer application (260) to generate or store a file (280) representing an electronic document including the translation result. Within the file (280), a watermark indicating that a translation function has been applied to the electronic document, as described above with reference to FIG. 1, may be stored together with the translation result. The processor (210) may display the translation result on the display (110) using the viewer application (260).
[0061] According to one embodiment, the processor (210) may execute the electronic document manager (253) to perform operations related to the translation function. For example, when receiving an input for translation through the UI of the viewer application (260), the processor (210) may obtain text to be translated by the input (e.g., the first text (131) of FIG. 1) through the rendering engine (251). The processor (210) may execute the electronic document analyzer (254) to obtain or generate information to be used for executing the translation function from the obtained text (e.g., information to be input to the translation model (272)). The processor (210), which executes the translation function using the information and obtains a second text translated from the first text of the electronic document, may execute the rendering engine (251) to display the electronic document including the second text. The processor (210) may execute an electronic document analyzer (254) to determine whether to adjust (e.g., rearrange) the arrangement of the content of the electronic document to display the second text. If it is determined to adjust the arrangement of the content of the electronic document, the processor (210) may execute a rendering engine (251) along with a request to adjust the arrangement.
[0062] According to one embodiment, the processor (210) may execute an electronic document analyzer (254) to execute an analysis function for the electronic document. The analysis function may include a function of grouping texts included in the electronic document to create groups of texts, such as paragraphs and / or paragraphs. The analysis function may include a function of checking whether a result of executing a translation function (hereinafter, referred to as a translation result) overlaps with other content of the electronic document. The analysis function may include an operation of adjusting properties of the translation result (e.g., a style of text included in the translation result, and / or dimensions (e.g., width and / or height) of an area of the electronic document where the translation result is to be displayed) so that the translation result does not overlap with other content.
[0063] As described above, the processor (210) may execute the rendering engine (251) to perform an operation for visualizing an electronic document on the display (110). The processor (210) may execute the rendering engine (251) to generate images corresponding to a plurality of objects included in the electronic document (e.g., a set of information representing the content of the electronic document, defined by a portable document format (PDF)). The images may be arranged on the display (110) or may be overlaid, depending on the arrangement of the content of the electronic document. For example, the processor (210) may generate an electronic document view (252) including a buffer in the memory (220) in which an image of the electronic document to be displayed on the display (110) is stored. The processor (210) that executes the electronic document view (252) may store information for displaying at least a portion of the electronic document rendered by the rendering engine (251) on the display (110).
[0064] Hereinafter, with reference to FIG. 3, the operation of an electronic device (101) and / or a processor (210) that executes a viewer application (260) to create a file (280) is described.
[0065] FIG. 3 is a flowchart illustrating an operation of an electronic device for determining an area of an electronic document (e.g., an electronic document (130) of FIG. 1) in which text obtained by executing a translation function (e.g., a second text (151) of FIG. 1) is to be displayed. The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIG. 3. For example, at least one of the operations of FIG. 3 may be performed by the electronic device (101) and / or the processor (210) of FIG. 2. The order of the operations illustrated in FIG. 3 is exemplary, and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 3 in a different order from the operations illustrated in FIG. 3. For example, the electronic device may perform at least two of the operations of FIG. 3 substantially simultaneously.
[0066] Referring to FIG. 3, in operation (310), according to one embodiment, an electronic device may receive an input for translating a first text located in a first area of an electronic document (e.g., first text (131) of FIG. 1). The electronic device may receive the input of operation (310) while displaying an electronic document including the first text (e.g., an electronic document identified by parsing a file (280) of FIG. 2). The embodiment is not limited thereto, and the electronic device may receive the input of operation (310) before displaying the electronic document (e.g., while displaying an icon representing a file including the electronic document).
[0067] Referring to FIG. 3, in operation (320), according to an embodiment, an electronic device may obtain tag information indicating properties of a first text. The electronic device may obtain tag information of operation (320) by executing the rendering engine (251) of FIG. 2. The electronic device may perform operation (320) based on receiving the input of operation (310). In operation (320), the electronic device may obtain tag information of operation (320) by executing the tag converter (255) of FIG. 2. The tag information may include characters indicating the style of at least a portion of the first text. For example, the tag information may have a format based on a mark-up language such as extended marked-up language (XML). The embodiment is not limited thereto, and may have another format defined to indicate the style of text, such as cascaded style sheets (CSS).
[0068] Referring to FIG. 3, in operation (330), according to an embodiment, an electronic device may execute a translation function for a first text. The electronic device may execute the translation service (262) and / or the translation model (272) of FIG. 2 to execute the translation function of operation (330). The translation function of operation (330) may be performed by an on-device model designed to be executed by a processor of the electronic device (e.g., the processor (210) of FIG. 2). The embodiment is not limited thereto, and the electronic device may request a translation of the first text from an external electronic device including an artificial intelligence model. The request may include the first text and tag information of operation (320). From the external electronic device that received the request, the electronic device may receive a translation result for the first text.
[0069] In one embodiment, the order in which operations (320, 330) are performed is not limited to the order illustrated in FIG. 3. For example, the electronic device may perform operation (330) and then operation (320). For example, the electronic device may perform operations (320, 330) substantially simultaneously based on multi-tasking, such as multi-threading.
[0070] Referring to FIG. 3, in operation (335), according to one embodiment, an electronic device may identify a size of a first region based on a first text. The electronic device may identify or calculate a size of a first region occupied by the first text within an electronic document using tag information (or attributes of the first text) of operation (320). The first region may correspond to the first region of operation (310). The size of the first region identified based on operation (335) may include a height, a width, and / or a shape of the first region.
[0071] Referring to FIG. 3, in operation (340), according to an embodiment, an electronic device may identify a size of a second area for displaying a second text using a second text translated from a first text and tag information. A result obtained by executing a translation function may include the second text and tag information indicating a style of at least a portion of the second text. The tag information may correspond to the tag information of operation (320). For example, if tag information corresponding to a first portion of the first text is obtained based on operation (320), the tag information of the second text of operation (340) may indicate that the style of the second portion of the second text corresponding to the first portion is the same as the style of the first portion.
[0072] An electronic device performing operation (340) may identify a size of a second area for displaying the second text based on the style of the second text indicated by the tag information of operation (320). The electronic device may identify the second area of operation (340) within at least a portion of the electronic document in which the first area for displaying the first text is located. For example, the second area may be identified within the first area of the rectangle in which the first text was displayed, or may be identified within the first area and a blank area adjacent to the first area. If the first text is adjacent to a grid such as a table and / or lines, the electronic device may identify the second area of operation (340) based on the grid and / or lines (e.g., within the grid and / or within a portion of the electronic document that does not overlap with the lines). For example, the size of the second area may be determined based on a size of a portion of the electronic document in which the first text is located (e.g., a paragraph and / or a (virtual) page). For example, the electronic device may calculate or identify the width, height, and / or area of the second region. For example, the electronic device may identify or calculate the size of the second region within the electronic document for displaying the second text using the font size and / or line spacing of the first text. Based on identifying the size of operation (340), the electronic device may perform operation (350).
[0073] Referring to FIG. 3, in operation (350), according to one embodiment, the electronic device may determine or determine whether the size of the second area identified based on operation (340) is larger than or equal to the size of the first area of the electronic document where the first text is located. If the size of the second area of operation (340) is larger than (or wider than) or equal to (350—Yes), the electronic device may perform operation (360). If the size of the second area of operation (340) is smaller than (or narrower than) the first area where the first text is located (350—No), the electronic device may perform operation (370). As will be described later with reference to operations (360, 370), the electronic device can perform operation (350) to determine or check whether the entire second text, which is the result of the translation, is included in the first area within the electronic document where the first text, which is the original text of the second text, is displayed.
[0074] Referring to FIG. 3, in operation (360), according to one embodiment, an electronic device may perform a layout algorithm to determine an area of an electronic document where a second text is to be displayed. For example, the layout algorithm may be performed such that the area of the electronic document where the second text is to be displayed is included in a first area of the electronic document where the first text is located and a blank area adjacent to the first area. For example, the layout algorithm may be performed such that the area of the electronic document where the second text is to be displayed is bounded by other content of the electronic document adjacent to the first text. For example, the layout algorithm may be performed such that the area of the electronic document where the second text is to be displayed is reduced to a size equal to or smaller than the size of the first area of the electronic document where the first text is located.
[0075] In one embodiment, the placement algorithm may include one or more methods. In the present disclosure, a first method may refer to a method of determining an area of an electronic document where a second text is to be displayed, within a first area of an electronic document where a first text is located and a blank area adjacent to the first area. The first method is described with reference to FIGS. 6, 7A, and / or 7B. In the present disclosure, a second method may refer to a method of reducing an area of an electronic document where the second text is to be displayed by adjusting the style of the second text (e.g., font size and / or line spacing). The second method is described with reference to FIGS. 8, 9, and / or 10. In the present disclosure, a third method may refer to a method of moving other content adjacent to the second text within the electronic document. The third method is described with reference to FIGS. 11 and 12.
[0076] The electronic device can selectively perform at least one of the first to third methods. The electronic device can sequentially perform at least two of the first to third methods. The electronic device can sequentially perform all of the first to third methods. The order in which at least one or two of the first to third methods are performed is not limited to the examples of the present disclosure. The operation of the electronic device performing the first to third methods according to the exemplary order is described with reference to FIG. 5. By performing the arrangement algorithm of operation (360), the electronic device can determine or set the area of the electronic document where the second text is to be displayed so that the area of the electronic document where the second text is to be displayed does not overlap with other content of the electronic document.
[0077] Referring to FIG. 3, in operation (370), according to one embodiment, an electronic device may insert an object related to a second text into an electronic document. An object of operation (370) may refer to a set of information representing at least a portion of the content of an electronic document, as defined in a PDF. Within a binary-encoded PDF file, an object may be defined by a pair of reserved words (e.g., “obj” and “endobj”) specified within a body area. A plurality of objects may be defined or standardized for each of various contents within the electronic document, including text, images, paths, tables, forms, paths, and / or shading objects. An object may be referred to as a document object and / or a document element.
[0078] When visualizing an electronic document contained in a PDF-based file (e.g., file (280) of FIG. 2), an electronic device may identify or recognize (e.g., parse) a plurality of objects from the file. The identified plurality of objects may each correspond to different portions of the content of the electronic document. When rendering the electronic document on a display (e.g., display (110) of FIG. 2), the electronic device may store information for visualizing the electronic document (e.g., the plurality of objects) in a memory (e.g., memory (220) of FIG. 2, such as a volatile memory). By performing operation (370), the electronic device may insert an object representing a second text into the information stored in the memory. Referring to FIG. 6, when the electronic device performs a placement algorithm based on operation (360), the object inserted based on operation (370) may represent a second text having a shape, size, and / or position according to the placement algorithm of operation (360).
[0079] Referring to operations (350, 360, 370) of FIG. 6, if the size of the area for displaying the second text is larger than the size of the first area, the electronic device may perform a placement algorithm to determine an object corresponding to the second text. Based on the placement algorithm, the electronic device may determine the size and / or position of the area including the second text, or change the size and / or position of other content within the electronic document adjacent to the second text.
[0080] Referring to operations (350, 360, 370) of FIG. 6, if the size of the area for displaying the second text is smaller than the size of the first area, the electronic device may not perform the placement algorithm. For example, the electronic device may display the second text in the first area of operation (350). Since the size of the area for displaying the second text is smaller than the size of the first area, the entire second text may be included in the first area. In the above example, as long as the first text does not overlap with other content of the electronic document, the second text does not overlap with other content of the electronic document. The electronic device may determine an area starting from the start position of the first area and having a size identified based on operation (340) as the area where the second text will be positioned (or displayed).
[0081] Referring to FIG. 3, in operation (380), according to one embodiment, an electronic device may determine or modify tag information of a first text and / or a second text within an electronic document. For example, the electronic device may add a first designated value (e.g., a first flag value) to tag information corresponding to the first text, indicating that the text is an original (or original text) of the electronic document. For example, the electronic device may add a second designated value (e.g., a second flag value) to tag information corresponding to the second text, indicating that the text is a translation of the electronic document.
[0082] For example, the electronic device may set or change tag information corresponding to the first text to stop (e.g., hide) displaying the first text through the display. For example, if objects of an electronic document are stored in a buffer formed in memory for displaying the electronic document, the electronic device may remove the object corresponding to the first text from the memory. For example, the electronic device may move the object corresponding to the first text from the buffer to another area. For example, the electronic device may assign a flag value and / or an attribute to the first text to reduce or eliminate visibility. For example, the electronic device may add or assign the flag value and / or the attribute to an object corresponding to the first text.
[0083] In one embodiment, the order in which the operations (370, 380) are performed is not limited to the order illustrated in FIG. 3. For example, the electronic device may perform the operations (370, 380) in a different order (e.g., in the opposite order) than the order illustrated in FIG. 3. For example, the electronic device may perform the operations (370, 380) substantially simultaneously (e.g., multi-tasking).
[0084] Referring to FIG. 3 , in operation (390), according to one embodiment, an electronic device may display at least a portion of an electronic document including a second text. Since the electronic device hides the first text based on operation (380), at least a portion of the electronic document displayed in operation (390) may not include the first text. For example, if the second text is displayed in the first area where the first text is located, the electronic device may perform operation (390) to provide a user experience as if the first text has been replaced with the second text.
[0085] As described above, according to one embodiment, when the electronic device executes a translation function to change at least a portion of an electronic document (e.g., the first text of operation (310)), the electronic device may check a positional relationship between content to be displayed in the changed at least portion (e.g., the second text of operation (340)) and other content. When the content overlaps or collides with the other content, the electronic device may perform the arrangement algorithm of operation (360) to resolve the overlap and / or the collision. Based on the arrangement algorithm, the electronic device may generate or display an electronic document in which the content is naturally mixed (or fused).
[0086] According to one embodiment, the electronic device may obtain or generate information for maintaining the style of the original text prior to executing the translation function, such as tag information of operation (320), from the translation result obtained by executing the translation function. PDF is standardized to include texts having one style in one object, and is standardized to define texts having multiple styles as multiple objects, respectively. According to one embodiment, the electronic device may generate a single string including the tag information of operation (320) from a plurality of objects corresponding to each of the texts having different styles. Hereinafter, with reference to FIG. 4, an exemplary operation of the electronic device for generating a single string to be used for executing the translation function from a plurality of objects is described.
[0087] FIG. 4 illustrates exemplary operations of an electronic device that executes a translation function using objects (420) representing text of an electronic document. The electronic device (101) described with reference to FIGS. 1 and 2 can perform the operations described with reference to FIG. 4. For example, the electronic device (101) and / or the processor (210) of FIG. 2 can perform the operations of FIG. 4. The operations of the electronic device of FIG. 4 may be related to at least one of the operations of FIG. 3 (e.g., operations (320, 330, 340)).
[0088] Referring to FIG. 4, an exemplary first text (410) to be translated based on a translation function (e.g., "Hello, my name is Hong Gil-dong") is illustrated. The electronic device can identify the first text (410) based on the input of the action (310). The first text (410) may be included in an electronic document (e.g., the electronic document represented by the file (280) of FIG. 2 and / or the electronic document (130) of FIG. 1).
[0089] When receiving an input for translating a first text (410) of an electronic document based on PDF, the electronic device may identify objects (420) representing the first text (410). The objects (420) may be included in a file representing the electronic document (e.g., file (280) of FIG. 2 ) or may be encoded. Referring to FIG. 4 , objects (420) corresponding to the first text (410) having an exemplary style are illustrated. To illustrate the embodiment in black and white drawing(s), a portion having a red color (e.g., "Name") within the first text (410) may be underlined. It is assumed that a portion different from the above portion within the first text (410) has a designated color (e.g., a default color), such as black. It is assumed that a specific portion (e.g., "Hong Gil-dong") within the first text (410) is visually emphasized relative to the rest of the portion by a font effect referred to as bold.
[0090] A PDF can be configured to define texts having different styles as different objects corresponding to each of the styles. In the exemplary first text (410), the text (“Hello, my”) before the part in red (“the part where the name is displayed”) can be defined as one object (e.g., object[0]). In the exemplary first text (410), the text in red (“name”) can be defined as one object (e.g., object[1]). In the exemplary first text (410), the text between the text in red (“name”) and the bold text (“Hong Gil-dong”) can be defined as one object (e.g., object[3]). In the exemplary first text (410), the bold text can be defined as one object (e.g., object[4]). Within the exemplary first text (410), the text following the bold text ("is.") may be defined as a single object (e.g., object[5]). For example, based on portions having different styles (e.g., portions each containing "Name" and "Hong Gil-dong"), the first text (410) may be represented by five objects. When identifying a file in which objects (420) are stored, the electronic device may render an electronic document including the first text (410) to sequentially render the objects (420).
[0091] In one embodiment, an electronic device, in response to an input for executing a translation function for a first text (410), may obtain or generate first data (430) including the first text (410) and a first tag representing a style of a portion of the first text (410). Using the first data (430), the electronic device may execute a translation function to obtain a second text translated from the first text. For example, using the first data (430), the electronic device may execute a translation function to obtain the second text.
[0092] Referring to FIG. 4, first data (430) is illustrated, which is generated by an electronic device and includes first text (410) and tag information representing styles of at least a portion of the first text (410). The tag information included in the first data (430) includes characters enclosed in pointy brackets (e.g., " <text> ", " <red> ", " <bold> ", "< / bold> < / red> < / text> ", "", "") can be included. For example, the tag " <text>"is, tag"< / text> " can be paired with, and the information between the paired tags can indicate that it is the text of an electronic document. For example, tags " <red> ", "< / red> "A pair of tags can indicate that the text between the paired tags is colored red. For example, tags " <bold> ", "< / bold> "A pair of tags may indicate that a font effect, referred to as bold, is applied to the text between the paired tags.
[0093] According to one embodiment, the electronic device may execute a translation function using first data (430). For example, the electronic device may input the first data (430) or information representing the first data (430) (e.g., a vector representation of the first data (430), referred to as a token) into a translation model (272). The translation model (272) of FIG. 4 may correspond to the translation model (272) of FIG. 2. The translation model (272) may be executed by a processor of the electronic device (e.g., the processor (210) of FIG. 2) (e.g., an on-device model) or may be executed remotely by a server connected to the electronic device.
[0094] In one embodiment, the translation model (272) can be trained so that the meaning (or content) of the first text (410) represented by the first data (430) is maintained while maintaining the tag information included in the first data (430). Within the translation model (272) that receives the first text (410), tags included in the first text (410) (e.g., " <text> ", " <red> ", " <bold> ", "< / bold> < / red> < / text> ", "", "") can be changed to reserved words (or reserved tags) that represent tags. For example, the tag " <text>"is a reservation tag" <u1>"with, tag" <red>"is, reservation tag" <u2>" can be changed. The mapping between tags and reservation tags is not limited to the above example. In one embodiment, the translation model (272) can be executed with a prompt indicating translation of the remaining text excluding the tags of the first data (430) (e.g., "Translate the text excluding the tags. The tags must be included in the translation result so that the translation result has the same style as the original text.").
[0095] Referring to FIG. 2, exemplary second data (440) obtained by executing a translation model (272) is illustrated. When translating a first text (410) by executing a translation model (272), if tags included in the first text (410) are changed to reserved tags, the second data (440) may be generated or obtained by replacing each of the reserved tags with a corresponding tag within the data output from the translation model (272).
[0096] Referring to the first data (430) and the second data (440) of FIG. 4, tags included in the first data (430) may be included in the second data (440), and the positions of the tags in the second data (440) may be adjusted to surround another word (e.g., a word in a second language, such as English) corresponding to a word surrounded by tags in the first data (430) (e.g., a word in a first language, such as Korean). For example, tags " <red> ", "< / red> "The location of the tags" <red> ", "< / red> " can be changed to wrap the text ("name") of the second data (440) corresponding to the translation of the text ("name") within the first data (430) wrapped by ". For example, tags within the second data (440) " <bold> ", "< / bold> "pairs of tags" <bold> ", "< / bold> "The text "Hong Gil-Dong" of the second data (440), which is a translation of the text "Hong Gil-Dong" in the first data (430) wrapped by ", can be changed to wrap. For example, tags wrapping the entire texts of the first data (430) " <text> ", "< / text> "This can be positioned within the second data (440) so as to encompass the entire text of the second data (440).
[0097] Referring to FIG. 4, an electronic device that has acquired second data (440) can display second text (460) represented by the second data (440) on a display (e.g., the display (110) of FIG. 1 and / or FIG. 2). The electronic device can change the style of at least a portion of the second text (460) using one or more tags included in the second data (440). For example, the electronic device can display a portion of the second text (460) (e.g., “name”) in red based on a tag of the second data (440). For example, the electronic device can display a portion of the second text (460) (e.g., “Hong Gil-Dong”) in bold based on a tag of the second data (440). Although exemplary operations of an electronic device that directly generates or displays second text (460) from second data (440) have been described, the embodiments are not limited thereto.
[0098] For example, the electronic device can generate objects (450) that can be added to a PDF-based file from the second data (440). As described above with reference to objects (420), since portions of texts included in the second data (440) have different styles, the electronic device can generate multiple objects (450) from the second data (440). For example, within the texts represented by the second data (440) (e.g., "Hello, my name is Hong Gil-Dong."), the text before the portion "name" having a red color ("Hello, my ") can be defined as one object (e.g., object[0]). For example, within the texts represented by the second data (440), the text "name" having a red color can be defined as one object (e.g., object[1]). For example, within the second data (440), the text ("is") between the red text ("name") and the bold text ("Hong Gil-Dong") may be defined as one object (e.g., object[3]). For example, the bold text ("Hong Gil-Dong") may be defined as one object (e.g., object[4]). For example, within the second data (440), the text (".") following the bold text may be defined as one object (e.g., object[5]).
[0099] In one embodiment where the electronic device obtains the second text (460) translated from the first text (410), the objects of the operation (370) of FIG. 3 may include the objects (450) of FIG. 4. For example, the electronic device may replace or change the objects (420) corresponding to the first text (410) within the electronic document with the objects (450). For example, the electronic device may assign attribute values to the objects (420) within the electronic document indicating that the first text (410) corresponding to the objects (420) is removed or hidden by the translation function. The electronic device may insert or add the objects (450) within the electronic document. The objects (450) may include attribute values indicating that the second text (460) represented by the objects (450) is a result of performing the translation function.
[0100] As described above, according to one embodiment, the electronic device may execute a translation function based on the translation model (272) to obtain second data (440) including a second text (460) and one or more tags indicating the style of at least a portion of the second text (460). The tags included in the second data (440) may be included in the second data (440) such that the style of a first portion of the first text (410) is maintained in a second portion of the second text (460), which is a translation of the first portion. For example, the second data (440) obtained using the first data (430) including a first tag indicating the style of the first portion may include a second tag corresponding to the first tag. The second tag may indicate the style of the second portion corresponding to the first portion. The style of the second portion indicated by the second tag may correspond to or be identical to the style of the first portion.
[0101] In order to display the second text (460) obtained by executing a translation function for the first text (410), the electronic device can identify the size of the area for displaying the second text (460). The size of the area can be calculated or identified based on tags included in the second data (440). Hereinafter, with reference to FIG. 5, an exemplary operation of the electronic device for displaying an electronic document including the second text (460) based on the size of the area for displaying the second text (460) indicated by the second data (440) is described.
[0102] FIG. 5 illustrates a flowchart of operations of an electronic device executing a layout algorithm for displaying text (e.g., the first method described with reference to FIG. 3). The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIG. 5. For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform at least one of the operations of FIG. 5. The order of the operations of FIG. 5 is exemplary, and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 5 in a different order than the order of the operations of FIG. 5. For example, the electronic device may perform at least two of the operations of FIG. 5 substantially simultaneously.
[0103] The operations of FIG. 5 may be performed by the electronic device as at least a part of the arrangement algorithm of operation (360). For example, the electronic device may perform the operations of FIG. 5 to determine an area of the electronic document for displaying the second text when displaying an electronic document including a second text translated from a first text. For example, the electronic device may perform the operations of FIG. 5 when the size of the area for displaying the second text is larger (or wider) than the size of the first area of the electronic document including the first text. Alternatively, the electronic device may perform the operations of FIG. 5 when the length of characters of the second text translated from the first text is longer than the length of characters of the first text.
[0104] Referring to FIG. 5, in operation (510), according to one embodiment, the electronic device may determine an area in which a second text translated from the first text is to be displayed, using a blank area adjacent to a first area of the electronic document where the first text is located. The first text of operation (510) may include the first text (131) of FIG. 1 and / or the first text (410) of FIG. 4. When the electronic device displays the first text of the electronic document based on PDF, the first text may correspond to one or more objects (e.g., objects (420) of FIG. 4). The second text of operation (510) may include the second text (151) of FIG. 1 and / or the second text (460) of FIG. 4. For example, the second text of operation (510) may correspond to the first text of operation (510). Within an electronic document based on PDF, the second text may correspond to one or more objects (e.g., objects (450) of FIG. 4).
[0105] The operation of determining the area of the operation (510) may include an operation of changing (e.g., increasing) at least one of the dimensions (e.g., width, height, and / or area) of the area of the operation (510). For example, the electronic device may increase the width of the area of the operation (510) to be greater than or equal to the width of the first area. The electronic device may increase the width of the area of the operation (510) to be equal to the sum of the width of the first area and the width of a blank area adjacent to the first area (e.g., a blank area connected to the first area along a horizontal direction). For example, the electronic device may increase the height of the area of the operation (510) to be greater than or equal to the height of the first area. The electronic device may increase the height of the area of the operation (510) to be equal to the sum of the height of the first area and the height of a blank area adjacent to the first area (e.g., a blank area connected to the first area along a vertical direction). The electronic device may increase the area of the operation (510) within an area including the first area and the blank area. The operation (510) of FIG. 5 may correspond to the first method described with reference to FIG. 3. An embodiment of an electronic device performing the operation (510) is described with reference to FIG. 6, FIG. 7a, and / or FIG. 7b.
[0106] Referring to FIG. 5, in operation (520), according to one embodiment, the electronic device may determine or check whether the second text overlaps with other content of the electronic document. For example, when displaying the second text in the determined area of operation (510), the electronic device may check whether the second text overlaps with other content of the electronic document. If the second text does not overlap with other content (520—No), the electronic device may perform operation (560). If the second text overlaps with other content (520—Yes), the electronic device may perform operation (530). If the sum of the first area and the blank area is smaller than the size of the area required to display the second text, the second text may overlap with other content.
[0107] Referring to FIG. 5, in operation (530), according to one embodiment, the electronic device may change the style (e.g., font size, kerning, and / or line spacing) of the second text. For example, the electronic device may change the style of the second text so that the size of the area of the electronic document for displaying the second text is reduced. The electronic device may change the style of the second text based on the style of text in the electronic document other than the second text. For example, the electronic device may reduce the font size of the second text based on the relationship between the font sizes of the second text and the other text and the font size of the second text. For example, if the font size of the second text is larger than the font size of the other text, the electronic device may reduce the font size of the second text within a range greater than or equal to the font size of the other text. The embodiment is not limited thereto, and the electronic device may change the style of the second text based on the relationship between the font sizes of portions of the second text. The operation (530) of FIG. 5 may correspond to the second method described with reference to FIG. 3. An embodiment of an electronic device performing the operation (530) is described with reference to FIG. 8, FIG. 9, and / or FIG. 10.
[0108] Referring to FIG. 5, in operation (540), according to an embodiment, the electronic device may determine whether the second text with the changed style overlaps with other content of the electronic document. For example, when displaying the second text based on the changed style of operation (530), the electronic device may determine or check whether the second text overlaps with other content of the electronic document. If the second text overlaps with other content (540 - Yes), the electronic device may perform operation (550). If the second text does not overlap with other content (540 - No), the electronic device may perform operation (560). The embodiment is not limited thereto, and if the size of the area for displaying the second text with the changed style is larger than the size of the first area, the electronic device may perform operation (550).
[0109] Referring to FIG. 5 , in operation (550), an electronic device according to one embodiment may change (e.g., enlarge, and / or add) a page of an electronic document to determine an area within the electronic document where second text will be displayed that does not overlap with other content. The page of operation (550) may be a virtual page set within the electronic document. When printing the electronic document, one or more virtual pages may be set within the electronic document to display the form of the electronic document within the actual page. For example, the virtual page may be set to correspond to the size of an actual page (e.g., an A4 sheet and / or a US Letter sheet).
[0110] For example, an electronic device may enlarge a page of an electronic document where a second text is located. Within the enlarged page, the electronic device may move other content of the electronic document adjacent to the second text so that the second text does not overlap with the other content. For example, the electronic device may add a page after the page of the electronic document where the second text is located. To the added page, the electronic device may move other content of the electronic document adjacent to the second text. When moving to the page where the other content is added, a blank area within the page of the electronic document where the second text is located may be enlarged. Using the enlarged blank area, the electronic device may display the second text that does not overlap with the other content. Operation (550) of FIG. 5 may correspond to the third method described with reference to FIG. 3. An embodiment of an electronic device performing operation (550) is described with reference to FIG. 11 and / or FIG. 12.
[0111] Referring to FIG. 5 , in operation (560), according to one embodiment, an electronic device may display an electronic document including a second text. As described above with reference to FIG. 5 , after the first to third methods are sequentially (or selectively) performed, the second text and other content may be spaced apart from each other within the electronic document. In operation (560), the electronic device may display an electronic document including the second text and other content spaced apart from the second text. The embodiment is not limited thereto, and the electronic device may store or print the electronic document of operation (560) including the second text.
[0112] FIG. 6 is a flowchart illustrating an operation of an electronic device that determines an area of text in an electronic document using a blank area. The electronic device (101) of FIGS. 1 and 2 may perform the operation described with reference to FIG. 6. For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operation described with reference to FIG. 6. The operations of FIG. 6 may be related to operation (360) of FIG. 3 and / or operation (510) of FIG. 5. The order of the operations of FIG. 6 is exemplary, and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 6 in a different order than that illustrated in FIG. 6. For example, the electronic device may perform at least two of the operations of FIG. 6 substantially simultaneously.
[0113] Referring to FIG. 6, in operation (610), according to an embodiment, an electronic device may check a blank area located in a first direction (e.g., vertical direction) with respect to a first area of an electronic document where a first text is located. The first text of operation (610) may include the first text (131) of FIG. 1 and / or the first text (410) of FIG. 4. Within the electronic document, the blank area of operation (610) may be connected to or in contact with the first area of operation (610) along the first direction. The electronic device that has checked the blank area located in the first direction may perform operation (620).
[0114] Referring to FIG. 6, in operation (620), according to one embodiment, the electronic device may determine or identify whether a second text translated from a first text can be displayed using a first area and a blank area located in a first direction. The second text of operation (620) may include the second text (151) of FIG. 1 and / or the second text (460) of FIG. 4. The second text of operation (620) may be a result of executing a translation function for the first text of operation (610). For example, the electronic device may check whether the entire second text translated from the first text can be displayed using the first area and the blank area located in the first direction. If the second text is included in the first area and the blank area of operation (610) (620 - Yes), the electronic device may perform operation (660). If the size of the area for displaying the second text exceeds the first area and the blank area of the operation (610) (620-No), the electronic device can perform the operation (630).
[0115] Referring to FIG. 6, in operation (630), according to an embodiment, an electronic device may check for a blank area located in a second direction (e.g., horizontal direction) perpendicular to a first direction with respect to a first area. In an electronic document, the blank area of operation (630) may be connected to or in contact with the first area of operation (610) along the second direction. The electronic device that has checked the blank area located in the second direction may perform operation (640). For example, operation (640) may be performed when there is a blank area located next to the first area along the second direction.
[0116] Referring to FIG. 6, in operation (640), according to one embodiment, the electronic device may determine or identify whether it can display a second text translated from a first text using the first area and the blank area located in the second direction. For example, the electronic device may check whether it can display the entire second text translated from the first text using the first area and the blank area located in the second direction. If the second text is included in the first area and the blank area of operation (630) (640—Yes), the electronic device may perform operation (660). If the second text is not included in the first area and the blank area of operation (630) (640—No), the electronic device may perform operation (650).
[0117] Referring to operations (610, 620, 630, 640) of FIG. 6, an embodiment of an electronic device that first checks a blank area in a vertical direction and then checks a blank area in a horizontal direction has been described, but the embodiment is not limited thereto. For example, the electronic device may first check a blank area in a horizontal direction and then check a blank area in a vertical direction. For example, the electronic device may check or determine whether a second text can be displayed using a combination of a first area, a blank area positioned vertically of the first area, and a blank area positioned horizontally of the first area. If the second text can be displayed in the combination, the electronic device may perform operation (660). If the second text cannot be displayed in the combination, the electronic device may perform operation (650).
[0118] Referring to FIG. 6, in operation (650), according to one embodiment, the electronic device may determine that the size of an area where a second text translated from a first text is to be displayed cannot be enlarged. If, in the first area, combining any blank area adjacent to the first area does not form an area having a size larger than the size of the area required to display the second text, operation (650) may be performed. The electronic device performing operation (650) may perform the operation in a manner different from the manner illustrated in FIG. 6 (e.g., the first manner described with reference to FIG. 3) (e.g., the second manner and / or the third manner described with reference to FIG. 3).
[0119] Referring to FIG. 6, in operation (660), according to one embodiment, the electronic device may determine to display second text in a second area, including a blank area identified based on at least one of operations (620, 640) and the first area. For example, the electronic device may perform operations (370, 380, 390) of FIG. 3. For example, the electronic device may perform operation (560) of FIG. 5. For example, the electronic device may display, store, or print an electronic document including the second text in the second area.
[0120] As described above, the electronic device can create or determine a second area where the second text is to be displayed by using a blank area formed within a page of an electronic document where the second text is to be displayed. If the size of the area required to display the second text is larger than the size of the first area for displaying the first text, the electronic device can determine or create the second area where the second text is to be displayed by combining at least a portion of the first area and the blank area.
[0121] Hereinafter, with reference to FIG. 7a and / or FIG. 7b, exemplary operations of an electronic device for determining a second area for displaying a second text using the operations of FIG. 6 are described.
[0122] FIGS. 7A and 7B illustrate exemplary operations of an electronic device for detecting a blank area adjacent to an area within an electronic document (700) in which text is displayed. The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIGS. 7A and / or 7B . For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operations described with reference to FIGS. 7A and / or 7B . The operations of FIGS. 7A and / or 7B may be related to operations (360) of FIG. 3 , (510) of FIG. 5 , and / or (6).
[0123] Referring to FIG. 7A, an example of an electronic device that at least partially translates an exemplary electronic document (700) is illustrated. For example, it is assumed that the electronic device receives an input for translating first text located in a first area (710) of the electronic document (700) (“To restart the product, press and hold the power button and then press Restart. If the product is not working and unresponsive, press and hold the power button and the volume down button simultaneously for more than 7 seconds to restart.”). The electronic device that receives the input can obtain the first text and first data representing the style of the first text (e.g., first data (430) of FIG. 4). For example, if a bold effect is applied to a portion of the first text (“Restart”), the electronic device can obtain the first data including a tag representing the bold effect.
[0124] For example, by executing a translation function using the first data, the electronic device can obtain second text translated from the first text ("To restart the device, press and hold the Power key, and then tap Restart. If your device is frozen and unresponsive, press and hold the Power key and the Volume Down key simultaneously for more than 7 seconds to restart it."). In the example, the first text may be referred to as the original text of the second text, and the first area (710) including the first text may be referred to as the original text area of the second text. The electronic device can obtain the second text and second data representing the style of the second text (e.g., the second data (450) of FIG. 4). The second data may include a tag for applying a bold effect to a portion of the second text ("Restart") corresponding to a portion of the first text ("Restart") to which the bold effect is applied.
[0125] For example, an electronic device that has identified second data including second text and tags (or tag information) indicating the style of the second text may identify or determine, using the second data and / or the second text, the size of an area for displaying the second text within an electronic document. If the identified size exceeds the size of the first area (710), the electronic device may decide to use an additional area outside the first area (710) to display the second text to be displayed in place of the first text in the first area (710). For example, if the entire second text cannot be displayed through the original area of the second text, the electronic device may display the second text through a combination of the original area and a blank area adjacent to the original area.
[0126] Referring to FIG. 7A, the electronic device may check for a blank area adjacent to the first area (710) along the vertical or horizontal direction of the electronic document (700) within the electronic document (700). For example, the electronic device may expand the first area (710) along the horizontal direction to identify a blank area (720) located in the horizontal direction of the first area (710). The blank area (720) may be referred to as a horizontal blank area with respect to the first area (710). For example, the electronic device may expand the first area (710) along the vertical direction to identify a blank area (730) located in the vertical direction of the first area (710). The blank area (730) may be referred to as a vertical blank area with respect to the first area (710).
[0127] Referring to FIG. 7A, an electronic device that identifies a horizontal blank area (e.g., blank area (720)) and a vertical blank area (e.g., blank area (730)) can obtain a union of the two blank areas. For example, the electronic device can identify a blank area (740) that includes both the horizontal blank area and the vertical blank area. The blank area (740), as a union of the blank areas (720, 730), can have a maximum width (e.g., the width of the blank area (720)) among the widths of the blank areas (720, 730) and a maximum height (e.g., the height of the blank area (730)) among the heights of the blank areas (720, 730). The blank area (740) can be referred to as a union area of the blank areas (720, 730).
[0128] For example, an electronic device that identifies a blank area (740), which is a union area of blank areas (720, 730), can search for or identify content of an electronic document (700) that overlaps with the blank area (740) (or is located within the blank area (740). Referring to FIG. 7A, a third area (750) including third text (“Restart Product”) of the electronic document (700) can at least partially overlap with the blank area (740). The electronic device that detects the third area (750) that overlaps with the blank area (740) can identify a portion of the blank area (740) that does not overlap with the third area (750). Referring to FIG. 7A, the electronic device that identifies a portion of the blank area (740) that does not overlap with the third area (750) can determine the portion as a second area (760) for displaying a second text.
[0129] Referring to FIG. 7b, an exemplary state in which a second text is displayed within a determined second area (760) is illustrated. If the size of the second area (760) is smaller than the size of the area required to display the second text, the electronic device may change the style of the second text (e.g., the second method) and / or move other content adjacent to the second text (e.g., the third method), instead of displaying the second text within the second area (760) as shown in FIG. 7b.
[0130] As described above, according to one embodiment, the electronic device includes a first area (710) corresponding to the first text, and can display a second text longer than the first text by using a second area (760) wider than the first area (710). When the first area (710) is represented by a combination (left, top, right, bottom) of an x-coordinate of a left edge of the first area (710), a y-coordinate of a top edge of the first area (710), an x-coordinate of a right edge of the first area (710) (right), and a y-coordinate of a bottom edge of the first area (710), the electronic device can obtain a combination of values representing the second area (760) on which the second text is to be displayed by increasing or decreasing any one of the values included in the combination.
[0131] For example, a blank area (720) generated by horizontally expanding a first area (710) represented by (left, top, right, bottom) can be expressed as (left - a, top, right + b, bottom). For example, a blank area (730) generated by vertically expanding a first area (710) can be expressed as (left, top - c, right, bottom + d). For example, a blank area (740) can be expressed as (left - a, top - c, right + b, bottom + d).
[0132] In one embodiment where the first area (710) is represented by a combination of specified coordinate values (left, top, right, bottom), the electronic device may determine the second area (760) by sequentially increasing or decreasing the values of the combination. For example, the electronic device may increase the right value of the combination (left, top, right, bottom) to extend into a blank area adjacent to the first area (710) along the horizontal direction. For example, the combination (left, top, right + a, bottom) may represent a combination of the first area (710) and a blank area located to the right of the first area (710). When identifying a that creates an area having a size greater than or equal to the size required to display the second text within a range less than or equal to the maximum width of the blank area, the electronic device may determine the area represented by the combination (left, top, right + a, bottom) as an area for displaying the second text.
[0133] If an area having a size larger than the size required to display the second text cannot be created within the maximum width of the above blank area, the electronic device may determine an area for displaying the second text by increasing or decreasing the left, top, and / or bottom. For example, the electronic device may determine or create an area for displaying the second text by increasing the bottom value within a range less than or equal to the maximum height of the blank area located below the first area (710).
[0134] Although an embodiment has been described in which the right value of the combination (left, top, right, bottom) is preferentially increased, the embodiment is not limited thereto. For example, when displaying a second text in Arabic, since Arabic characters are written from right to left, the electronic device can identify or determine an area for displaying the second text by preferentially changing the left value of the combination (left, top, right, bottom) (e.g., for a natural number a, (left - a, top, right, bottom)).
[0135] As described above, according to one embodiment, the electronic device may determine a second area (760) for displaying a second text translated from the first text by combining a horizontal blank area and / or a vertical blank area based on a first area (710) for displaying a first text. If the blank area adjacent to the first text is relatively small, the area for displaying the second text cannot be created simply by combining the blank area with the first area (710). In this case, the electronic device may change the style of the second text so that the second text does not overlap with other content of the electronic document.
[0136] Below, with reference to FIG. 8, an exemplary operation of an electronic device for changing the style of a second text is described.
[0137] FIG. 8 illustrates a flowchart of operations of an electronic device for changing the style of text. The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIG. 8. For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operations described with reference to FIG. 8. The operations of FIG. 8 may be related to operation (360) of FIG. 3 and / or operation (530) of FIG. 5. The order of the operations of FIG. 8 is exemplary and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 8 in a different order from the order illustrated in FIG. 8. For example, the electronic device may perform at least two of the operations of FIG. 8 substantially simultaneously.
[0138] Referring to FIG. 8, in operation (810), according to an embodiment, an electronic device may identify minimum values of attributes representing a style of a second text translated from a first text. The first text of operation (810) may include the first text (131) of FIG. 1 and / or the first text (410) of FIG. 4. The second text of operation (810) may include the second text (151) of FIG. 1 and / or the second text (460) of FIG. 4. The attributes of operation (810) may include, among parameters representing the shape and / or style of the text, attributes related to the size of an area for displaying the text (e.g., font size, line spacing, and / or kerning). When the first text includes characters having different styles, the electronic device may determine minimum values of styles of characters of the second text corresponding to each of the characters by utilizing the relationship of styles between the characters. The embodiment is not limited thereto, and the electronic device may identify or determine the minimum values of the attributes to be used to determine the style of the second text using the styles of other text in the electronic document adjacent to the first text.
[0139] Referring to FIG. 8, in operation (820), according to one embodiment, the electronic device may identify or check whether each of the attributes indicating the style of the second text is greater than a corresponding minimum value. If at least one of the attributes indicating the style of the second text is greater than the minimum value determined based on operation (810) (820—Yes), the electronic device may perform operation (830). If all of the attributes indicating the style of the second text are equal to or less than the minimum values of operation (810) (820—No), the electronic device may perform operation (860).
[0140] Referring to FIG. 8, in operation (830), according to an embodiment, an electronic device may reduce at least one of the attributes indicating the style of the second text. For example, the electronic device may reduce the line spacing of at least a portion of the second text. For example, the electronic device may reduce the font size of at least a portion of the second text. For example, the electronic device may reduce the letter spacing of at least a portion of the second text. For example, the electronic device may change the style of the second text (or the attribute value indicating the style) by reducing at least one of the font size, line spacing, and letter spacing. When at least one of the above-described attributes (e.g., font size, line spacing, and / or letter spacing) is reduced based on operation (830), the size of the area for displaying the second text may be reduced.
[0141] Referring to FIG. 8, in operation (840), according to one embodiment, the electronic device may identify or determine, based on the reduced property, whether the size of the area where the second text is to be displayed has been reduced to or smaller than the size of the first area where the first text is to be displayed (e.g., the first area (710) of FIG. 7A). For example, the electronic device may determine whether the area where the second text is to be displayed has been reduced to the original text area. If the size of the area where the second text is to be displayed is equal to or smaller than the size of the area where the first text is to be displayed (840—Yes), the electronic device may perform operation (850). If the size of the area where the second text is to be displayed is larger than the size of the area where the first text is to be displayed (840—No), the electronic device may perform operation (820) again.
[0142] Referring to operations (820, 830, 840), each of the properties indicating the style of the second text may be gradually reduced within a range greater than the corresponding minimum value. For example, the electronic device may gradually reduce at least one of the properties based on a specified interval and / or a specified number of times. When reducing at least two properties among the font size, line spacing, and / or kerning, the electronic device may preferentially reduce one of the at least two properties in a specified order. For example, the electronic device may gradually reduce the line spacing within a range greater than or equal to the minimum line spacing. Even after the line spacing is reduced to the minimum line spacing, if the size of the area where the second text is to be displayed is larger than the size of the first area where the first text is displayed, the electronic device may reduce the font size. In the above example, the electronic device may gradually reduce the font size within a range greater than or equal to the minimum font size. In the above example, even after the font size is reduced to the minimum font size, if the size of the area where the second text is to be displayed is larger than the size of the first area where the first text is displayed, the electronic device may reduce the letter spacing. In the above example, the electronic device may gradually reduce the letter spacing within a range greater than the minimum letter spacing.
[0143] The embodiment is not limited thereto, and the electronic device may first reduce the font size to the minimum font size and then reduce the line spacing. The embodiment is not limited thereto, and when adjusting the properties of the second text of a single line, the line spacing does not affect the size of the area for displaying the second text, so the electronic device may only adjust at least one of the font size and / or the letter spacing, and may not adjust the line spacing.
[0144] Referring to FIG. 8, in operation (850), according to one embodiment, the electronic device may determine an area within the electronic document where the second text is to be displayed based on the reduced properties. Referring to operations (840, 850), if the area where the second text is to be displayed is reduced to the size of the original text area, the electronic device may display the second text through the original text area. For example, the electronic device may display the second text, having an adjusted style based on operations (820, 830, 840), within the first area of operation (840). For example, the electronic device may display the second text from the start position of the first area.
[0145] Referring to FIG. 8, in operation (860), according to one embodiment, the electronic device may determine that the second text cannot be displayed in the first area by changing the style of the second text. For example, even though all properties of operation (810) have been reduced to minimum values, if the size of the area where the second text is to be displayed is larger than the size of the first area of operation (840), the electronic device may perform operation (860). The electronic device performing operation (860) may perform a different method (e.g., the second method described with reference to FIG. 3) than the method illustrated in FIG. 8 (e.g., the second method described with reference to FIG. 3) and / or the third method described with reference to FIG.
[0146] Hereinafter, with reference to FIG. 9 and / or FIG. 10, exemplary operations of an electronic device for determining an area within an electronic document corresponding to a second text by performing the operations of FIG. 10 are described.
[0147] FIG. 9 illustrates an exemplary operation of an electronic device for changing the style of exemplary text of an electronic document (900). The electronic device (101) of FIGS. 1 and 2 may perform the operation described with reference to FIG. 8. For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operation described with reference to FIG. 9. The operation of FIG. 9 may be related to operation (360) of FIG. 3, operation (530) of FIG. 5, and / or operations of FIG. 8.
[0148] Referring to FIG. 9, an embodiment of an electronic device that translates texts (e.g., first text (911), second text (912), and third text (913)) of an exemplary electronic document (900) is described. It is assumed that a first font size of the first text (911) (“Power On / Off”) is larger than a second font size of the second text (912) (“Restart the Product”), and a third font size of the third text (913) (“To restart the product, press and hold the power button and then press Restart. If the product is frozen and unresponsive, press and hold the power button and the volume down button simultaneously for more than 7 seconds to restart it”) is smaller than the second font size. It is also assumed that a fourth font size of the fourth text (“Press and hold the power button for several seconds to turn the product on”) is larger than the third font size and smaller than the second font size. For example, the order of font sizes may be reduced to a first font size, a second font size, a fourth font size, and a third font size.
[0149] By translating the electronic document (900) of FIG. 9, the electronic device can obtain the fifth text (921) translated from the first text (911) (“Turning the device on and off”), the sixth text (922) translated from the second text (912) (“Restarting the device.”), the seventh text (923) translated from the third text (913) (“To restart the device, press and hold the Power key, and then tap Restart. If your device is frozen and unresponsive, press and hold the Power key and the Volume Down key simultaneously for more than 7 seconds to restart it.”), and the eighth text (924) translated from the fourth text (914) (“Press hold the Power key for a few seconds to turn on the device.”). As described above with reference to FIG. 3, the electronic device can set the styles of each of the texts (921, 922, 923, 924) to the styles of each of the texts (911, 912, 913, 914), and can change the styles of the texts (921, 922, 923, 924) using the layout of the texts (921, 922, 923, 924) based on the set styles.
[0150] Hereinafter, an exemplary operation of an electronic device is described for determining areas of an electronic document where texts (921, 922, 923, 924) are to be displayed using the second method, after translating texts (911, 912, 913, 914) to obtain texts (921, 922, 923, 924). For convenience of explanation, it is assumed that the sizes of the areas where texts (921, 922, 923, 924) are to be displayed are larger than the sizes of the areas where texts (911, 912, 913, 914) are to be displayed.
[0151] In one embodiment, when reducing the font size of the fifth text (921), the electronic device may reduce the font size of the fifth text (921) within a range greater than the font sizes of other texts (e.g., the sixth text (922) and the seventh text (923)) having a smaller font size than the fifth text (921). For example, the electronic device may reduce the font size of the fifth text (921) within a range exceeding the font size of the sixth text (922) (e.g., the second font size). Similarly, the electronic device may reduce the font size of the sixth text (922) within a range exceeding the font size of the seventh text (923) (e.g., the third font size). In the above example, the font size of the fifth text (921) displayed through the electronic document (900) is larger than the font size of the sixth text (922), and the font size of the sixth text (922) is larger than the font size of the seventh text (923).
[0152] For example, the size of an area (919) within the electronic document (900) where the eighth text (“Press and hold the Power key for a few seconds to turn on the device.”) translated from the fourth text (914) is to be displayed can be calculated using the properties of the fourth text (914) (e.g., font size, font name, and / or kerning). Referring to FIG. 9, if the eighth text has the properties of the fourth text (914), the area (919) where the eighth text is to be displayed may exceed the blank area of the electronic document (900). For example, at least a portion of the area (919) where the eighth text is to be displayed may be located outside the virtual page of the electronic document (900). For example, it may be impossible to display the eighth text having the properties of the fourth text (914) using the blank area within the portion of the electronic document (900) where the fourth text (914) is located. The electronic device may identify an area (919) that exceeds the size of the area within the electronic document (900) of the fourth text (914), or adjust an attribute of the eighth text if the area (919) is larger than the electronic document (900) and / or the blank area.
[0153] For example, the electronic device can adjust the font size, font name, and / or kerning of the eighth text to reduce the size of the area where the eighth text is to be displayed to less than the area (919). Referring to FIG. 9, an embodiment of displaying the eighth text (924) having a font size less than the font size of the fourth text and kerning less than the kerning of the fourth text is illustrated. The electronic device can reduce the font size of the eighth text (924) within a range exceeding the font size of the seventh text (923). The electronic device can reduce the kerning of the eighth text (924) within a range exceeding the kerning of the seventh text (923).
[0154] As described above, according to one embodiment, the electronic device can maintain the order of font sizes among the texts when changing the font sizes of the translated texts. The order of the font sizes can indicate the positions of the texts (e.g., title, subtitle, and / or body) within the electronic document. The electronic device can reduce the font sizes of the texts while maintaining the order of the font sizes, so that the positions of the texts can be intuitively recognized without the texts overlapping with other content of the electronic document.
[0155] FIG. 10 illustrates exemplary operations of an electronic device based on other content of an electronic document adjacent to text. The electronic device (101) of FIGS. 1 and 2 can perform the operations described with reference to FIG. 10 . For example, the electronic device (101) and / or the processor (210) of FIG. 2 can perform the operations described with reference to FIG. 10 .
[0156] Referring to FIG. 10, an embodiment of an electronic device that translates a first text (“signature and seal”) in a first language (e.g., Korean) contained in a text box (e.g., a cell of a table) is described. Referring to state (1011), a first text having a font size of 20 may be displayed within a text box of an electronic document. Within state (1011), an electronic device that receives an input for translating the first text may obtain a second text (“signature and seal”) in a second language (e.g., English) translated from the first text.
[0157] When displaying the second text with the font size of the first text (e.g., 20), the size of the area for displaying the second text may exceed the size of the first area for displaying the first text. An electronic device that identifies the size of the area exceeding the size of the first area may reduce the properties of the second text (e.g., font size) so that the second text is included in the first area. Referring to an exemplary state (1012) of FIG. 10, when the font size is reduced to 16, the second text may be included in the first area.
[0158] If another text box adjacent to the text box in which the first text is located (e.g., another cell adjacent to the cell of the first text in a table including the first text) is identified, the electronic device may change the font size of the second text using the font size of the other text located in the other text box. For example, if the other text has a font size exceeding 16, the electronic device may reduce the font size of the second text within a range exceeding 16. If the entire second text cannot be displayed through the text box within the range, the electronic device may omit a portion of the second text, as in state (1013) of FIG. 10. Referring to state (1013) of FIG. 10, while the electronic device displays the second text having a font size of 18, the electronic device may display a designated character (“…”) indicating omission of a portion of the second text located outside the text box (e.g., “al” of “signature and seal”), together with the remainder of the second text. Within state (1013), the electronic device may display the entire second text (e.g., a pop-up window and / or a toast) based on input associated with the specified character (e.g., a mouse click on the specified character, and / or a tap gesture).
[0159] Hereinafter, with reference to FIG. 11, an exemplary operation of an electronic device for creating an area within an electronic document for displaying a second text by changing content other than the second text is described.
[0160] FIG. 11 illustrates a flowchart of operations of an electronic device for at least partially modifying the content of a page including text. The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIG. 11. For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operations described with reference to FIG. 11. The operations of FIG. 11 may be related to operation (360) of FIG. 3 and / or operation (550) of FIG. 5. The order of the operations of FIG. 11 is exemplary and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 11 in a different order than the order of FIG. 11. For example, the electronic device may perform at least two of the operations of FIG. 11 substantially simultaneously.
[0161] Referring to FIG. 11, in operation (1110), according to one embodiment, an electronic device may translate a first text displayed in a first area (e.g., the first text (131) of FIG. 1 and / or the first text (410) of FIG. 4) to obtain a second text (e.g., the second text (151) of FIG. 1 and / or the second text (460) of FIG. 4). The electronic device may perform operation (1110) in response to an input for translating the first text (e.g., an input of operation (310) of FIG. 3). Together with the second text, the electronic device may obtain information (e.g., a tag) indicating a style of the second text. As described above with reference to operation (350) of FIG. 3, the electronic device may perform at least one of operations (1120, 1130, 1140) of FIG. 11 when the size of the second area of the electronic document in which the second text is to be displayed is larger than the size of the first area.
[0162] Referring to FIG. 11, in operation (1120), according to one embodiment, an electronic device may identify another object of an electronic document that is at least partially displayed within a second area of the electronic document where second text is to be displayed. Since the second text is displayed in place of the first text, the second area, which is larger than the first area of operation (1110), may include the first area. The electronic device may identify another object adjacent to the first area within the electronic document.
[0163] Referring to FIG. 11, in operation (1130), according to one embodiment, the electronic device may move another object so that another object of operation (1120) is displayed outside the second area. For example, within an electronic document, the electronic device may move the other object so that the distance between the other object of operation (1120) and the second area (or the first area) increases. To prevent the other object from overlapping another object, the electronic device may move the other object overlapping the second area and another object beyond the other object as a whole within a page (e.g., a virtual page where the second text will be located).
[0164] Referring to FIG. 11, in operation (1140), according to an embodiment, the electronic device may increase the size of a page or add a page within the electronic document based on whether at least a portion of another object has moved out of the page of the electronic document. For example, if another object has moved out of the page due to the movement in operation (1130), the electronic device may add a page within the electronic document. For example, the electronic device may add a page after the page where the second text is to be located. With the added page, the electronic device may move the other object that has moved out of the page. For example, the other object may be completely removed from the page where the second text is to be located. The embodiment is not limited thereto, and the electronic device may increase at least one of the width or the height of the page where the second text is to be located, so that the other object is included within the page.
[0165] As described above, the electronic device can move other content of the electronic document that is different from the second text so that the second text does not overlap with the other content. Based on the movement, the electronic device can make the second text not overlap with the other content while maintaining the font size (and / or style) of the second text.
[0166] Hereinafter, with reference to FIG. 12, an exemplary operation of an electronic device for adding a second text to an electronic document according to the third method described with reference to FIG. 11 is described.
[0167] FIG. 12 illustrates an exemplary operation of an electronic device that at least partially modifies the content of a page including text. The electronic device (101) of FIGS. 1 and 2 may perform the operation described with reference to FIG. 12 . For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operation described with reference to FIG. 12 . The operation described with reference to FIG. 12 may be related to operation (360) of FIG. 3 , operation (550) of FIG. 5 , and / or operations of FIG. 11 .
[0168] Referring to FIG. 12, an embodiment of an electronic device that translates texts (e.g., first text (1211), second text (1212), and third text (1213)) of an exemplary electronic document (1200) is described. It is assumed that the second text (1212) (e.g., an area having a height h1) is positioned within an area between the first text (1211) ("Power On / Off") and the third text (1213) ("Restart the Product"). The second text (1212) ("Press and hold the power button for several seconds to power on the product. In areas where the use of wireless devices is restricted, such as airplanes and hospitals, follow all warnings and instructions provided by the person in charge of the area.") is positioned.
[0169] By translating the electronic document (1200) of FIG. 12, the electronic device can obtain a fourth text (1221) translated from the first text (1211) (“Turning the device on and off”), a fifth text (1222) translated from the second text (1212) (“Press and hold the Power key for a few seconds to turn on the device. Follow all posted warnings and directions from authorized personnel in areas where the use of wireless devices is restricted, such as airplanes and hospitals.”), and a sixth text (1223) translated from the third text (1223) (“Restarting the device.”). As described above with reference to FIG. 3, each of the texts (1221, 1222, 1223) can have the styles (e.g., font size) of the texts (1211, 1212, 1213).
[0170] In one embodiment, the electronic device can determine whether texts (1221, 1222, 1223) overlap each other and / or whether texts (1221, 1222, 1223) overlap with other content of the electronic document (1200). Since the fifth text (1222) includes more characters than the second text (1212), the size of the area for displaying the fifth text (1222) may be larger than the size of the area (e.g., the area having a height h1) that includes the second text (1212). For example, when displaying the fifth text (1222) at a location where the second text (1212) was displayed, the fifth text (1222) may overlap with other texts (e.g., the fourth text (1221) and / or the sixth text (1223)).
[0171] In one embodiment, the electronic device may perform the third method to prevent the texts (1221, 1222, 1223) from overlapping each other. For example, the electronic device may move other content adjacent to the fifth text (1222) (e.g., content positioned below the fifth text (1222), including the sixth text (1223)) in a direction opposite to the fifth text (1222). For example, the electronic device may move the other content such that the distance between the fifth text (1222) and the other content increases. Referring to FIG. 12, based on the movement of the other content, the sixth text (1223) and the content below the sixth text (1223) may be moved to the bottom of the electronic document. Based on the movement, the distance between the sixth text (1223) and the fourth text (1221) may be increased to h2, which exceeds h1.
[0172] Referring to FIG. 12, within an area having a height of h2, the electronic device may display a fifth text (1222). The fifth text (1222) may be displayed within an area having a height h2 exceeding h1, and may not overlap with other text (e.g., the fourth text (1221) and / or the sixth text (1223)).
[0173] As described above, according to one embodiment, an electronic device can translate a first text into a second text for an electronic document including the first text. When displaying an electronic document including the second text replaced with the first text, the electronic device can change the arrangement of the content of the electronic document by utilizing the positional relationship between the second text and other content of the electronic document. For example, if the second text overlaps other content, the electronic device can utilize a blank area of the electronic document to display the second text. For example, the electronic device can adjust the style of the second text so that the second text is included within the area where the first text was displayed. For example, the electronic device can shift other content adjacent to the second text within the electronic document to create an area where the second text will be displayed.
[0174] Hereinafter, with reference to FIG. 13, an exemplary operation of an electronic device displaying a second text translated from a first text, in which an electronic document including the first text is re-displayed, is described.
[0175] FIG. 13 illustrates exemplary operations of an electronic device for displaying an electronic document that was displayed prior to executing a translation function, based on user input. The electronic device (101) of FIGS. 1 and 2 may perform the operations described with reference to FIG. 13 . For example, the electronic device (101) and / or the processor (210) of FIG. 2 may perform the operations described with reference to FIG. 13 . At least one of the operations of FIG. 13 may be performed while at least partially displaying the electronic document based on operation (390) of FIG. 3 , operation (560) of FIG. 5 , operation (660) of FIG. 6 , operation (850) of FIG. 8 , and operation (1140) of FIG. 11 . The order of the operations of FIG. 13 is exemplary, and the embodiment is not limited thereto. For example, the electronic device may perform the operations of FIG. 13 in a different order from the order illustrated in FIG. 13 . For example, the electronic device may perform at least two of the operations of FIG. 13 substantially simultaneously.
[0176] Referring to FIG. 13, in operation (1310), according to one embodiment, an electronic device may display an electronic document (700) including a first text in a first language (e.g., the first text (131) of FIG. 1 and / or the first text (410) of FIG. 4). Referring to FIG. 13, an exemplary case is illustrated in which an electronic device performing operation (1310) displays the electronic document (700) of FIGS. 7A and 7B. The electronic document (700) may include a first text in a first language (e.g., Korean) located in a first area (710).
[0177] Referring to FIG. 13, in operation (1320), according to one embodiment, an electronic device may receive a first input for translating a first text. The first input may include the input of operation (310). The electronic device receiving the first input may execute a translation function to obtain a second text corresponding to the first text.
[0178] Referring to FIG. 13, in operation (1330), according to one embodiment, an electronic device may display an electronic document (700) including a second text in a second language (e.g., the second text (151) of FIG. 1 and / or the second text (460) of FIG. 4) translated from a first text. The electronic device may generate or display the electronic document (700) including the second text based on the operations described with reference to FIGS. 1 to 12. Referring to FIG. 13, the electronic device performing operation (1330) may display the electronic document (700) including the second text in a second area (760) that is wider than the first area (710).
[0179] In one embodiment, an electronic device displaying an electronic document (700) including a second text of an operation (1330) can manage objects corresponding to the original text (e.g., an object corresponding to the first text of the operation (1310)) and objects corresponding to the translation (e.g., an object representing the second text of the operation (1330)) within the electronic document (700). For example, the electronic device can store a first set of objects representing the original text and a second set of objects representing the translation. The electronic document of the operation (1330) can be displayed by rendering objects included in the second set among the first set and the second set. For example, a state of displaying the electronic document of the operation (1330) can be described as a state of rendering objects included in the second set.
[0180] Referring to FIG. 13, in operation (1340), according to one embodiment, the electronic device may identify or determine whether a second input for displaying a first text (or an original electronic document) has been received. The electronic device, which displays a pop-up menu (140) for receiving a setting value related to translation, may receive the second input of operation (1340) through the pop-up menu (140). The second input may include an input for selecting an icon (1345) for stopping the display of the pop-up menu (140). If the second input is received (1340 - Yes), the electronic device may perform operation (1350). Prior to receiving the second input (1340 - No), the electronic device may continue to display the electronic document including the second text of operation (1330).
[0181] Referring to FIG. 13, in operation (1350), according to one embodiment, an electronic device may display an electronic document (700) including a first text among a second text and a first text. The electronic device, upon receiving a second input of operation (1340), may stop displaying a pop-up menu (140). The electronic device may render objects of the first set among the first set or the second set to display the electronic document (700) including the first text. The state of the electronic device displaying the electronic document (700) of operation (1350) may be described as a state in which the electronic device stops displaying a second text translated from the first text in the first language. For example, the electronic device may terminate a mode for displaying the second text (e.g., a translation mode) upon receiving the second input of operation (1340). In operation (1350), the electronic device may remove all objects of the second set stored in the memory in order to display the translated text. For example, within operation (1350), the state of the electronic document, and / or the state of the file representing the electronic document, can be restored to the state it was in at the time the electronic document of operation (1310) was displayed, independently of the second text.
[0182] As described above, according to one embodiment, an electronic device may selectively display or provide an original text and a translation of an electronic document. For example, the electronic device may store, in memory, a first set of objects representing the original text, together with a second set of objects for representing the translation. The electronic device may perform a mode switch based on the first set or the second set, based on a user input (e.g., the second input of operation 1340). For example, the electronic device, upon receiving the user input, may switch from a translation mode, which renders an electronic document including a translation based on the second set of objects, to an original text mode, which renders an electronic document including an original text based on the first set of objects.
[0183] Referring to FIGS. 1 to 13, an embodiment of changing the position and / or properties of at least one object included in a translation when the size of the translation (e.g., the number of characters included in the translation) is larger than the size of the original text (e.g., the number of characters included in the original text) corresponding to the translation (e.g., the electronic document (130) of FIG. 1), but the embodiment is not limited thereto. For example, when the size of the translation is smaller than the size of the original text, the electronic device may change the positions and / or properties of the objects included in the translation so as to reduce the spacing between the objects (e.g., the size of the blank area referred to as a margin) between the objects.
[0184] For example, when a first text in a first language is translated to obtain a second text in a second language, the electronic device may compare the size of a first area within the electronic document of the first text with the size of a second area within the electronic document of the second text. When displaying the second text using the properties of the first text, if the size of the second area is smaller than the size of the first area, the electronic device may move another object displayed after the second text within the electronic document so as to reduce the distance between the second text and the other object. For example, when the size of a paragraph (or paragraphs) represented by the second text is reduced as the number of characters in the second text is reduced, the electronic device may move another paragraph after the paragraph so as to reduce the space between paragraphs within the electronic document.
[0185] FIG. 14 is a block diagram of an electronic device (1401) within a network environment (1400) according to various embodiments. Referring to FIG. 14 , in the network environment (1400), the electronic device (1401) may communicate with the electronic device (1402) via a first network (1498) (e.g., a short-range wireless communication network), or may communicate with at least one of the electronic device (1404) or the server (1408) via a second network (1499) (e.g., a long-range wireless communication network). In one embodiment, the electronic device (1401) may communicate with the electronic device (1404) via the server (1408). According to one embodiment, the electronic device (1401) may include a processor (1420), a memory (1430), an input module (1450), an audio output module (1455), a display module (1460), an audio module (1470), a sensor module (1476), an interface (1477), a connection terminal (1478), a haptic module (1479), a camera module (1480), a power management module (1488), a battery (1489), a communication module (1490), a subscriber identification module (1496), or an antenna module (1497). In some embodiments, the electronic device (1401) may omit at least one of these components (e.g., the connection terminal (1478)), or may have one or more other components added. In some embodiments, some of these components (e.g., sensor module (1476), camera module (1480), or antenna module (1497)) may be integrated into a single component (e.g., display module (1460)).
[0186] The processor (1420) may, for example, execute software (e.g., a program (1440)) to control at least one other component (e.g., a hardware or software component) of the electronic device (1401) connected to the processor (1420) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (1420) may store commands or data received from other components (e.g., a sensor module (1476) or a communication module (1490)) in a volatile memory (1432), process the commands or data stored in the volatile memory (1432), and store result data in a non-volatile memory (1434). According to one embodiment, the processor (1420) may include a main processor (1421) (e.g., a central processing unit or an application processor) or an auxiliary processor (1423) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (1421). For example, when the electronic device (1401) includes the main processor (1421) and the auxiliary processor (1423), the auxiliary processor (1423) may be configured to use less power than the main processor (1421) or to be specialized for a given function. The auxiliary processor (1423) may be implemented separately from the main processor (1421) or as a part thereof.
[0187] The auxiliary processor (1423) may control at least a portion of functions or states associated with at least one component (e.g., the display module (1460), the sensor module (1476), or the communication module (1490)) of the electronic device (1401), for example, on behalf of the main processor (1421) while the main processor (1421) is in an inactive (e.g., sleep) state, or together with the main processor (1421) while the main processor (1421) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (1423) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (1480) or a communication module (1490)). In one embodiment, the auxiliary processor (1423) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, on the electronic device (1401) where the artificial intelligence model is executed, or can be performed through a separate server (e.g., server (1408)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.
[0188] The memory (1430) can store various data used by at least one component (e.g., the processor (1420) or the sensor module (1476)) of the electronic device (1401). The data can include, for example, software (e.g., the program (1440)) and input data or output data for commands related thereto. The memory (1430) can include volatile memory (1432) or non-volatile memory (1434).
[0189] The program (1440) may be stored as software in memory (1430) and may include, for example, an operating system (1442), middleware (1444), or an application (1446).
[0190] The input module (1450) can receive commands or data to be used in a component of the electronic device (1401) (e.g., a processor (1420)) from an external source (e.g., a user) of the electronic device (1401). The input module (1450) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0191] The audio output module (1455) can output audio signals to the outside of the electronic device (1401). The audio output module (1455) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.
[0192] The display module (1460) can visually provide information to an external party (e.g., a user) of the electronic device (1401). The display module (1460) may include, for example, a display, a holographic device, or a projector, and a control circuit for controlling the device. In one embodiment, the display module (1460) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.
[0193] The audio module (1470) can convert sound into an electrical signal, or vice versa. According to one embodiment, the audio module (1470) can acquire sound through the input module (1450), output sound through the sound output module (1455), or an external electronic device (e.g., electronic device (1402)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (1401).
[0194] The sensor module (1476) can detect the operating status (e.g., power or temperature) of the electronic device (1401) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (1476) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0195] The interface (1477) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (1401) with an external electronic device (e.g., the electronic device (1402)). In one embodiment, the interface (1477) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0196] The connection terminal (1478) may include a connector through which the electronic device (1401) may be physically connected to an external electronic device (e.g., the electronic device (1402)). In one embodiment, the connection terminal (1478) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0197] The haptic module (1479) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. In one embodiment, the haptic module (1479) may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
[0198] The camera module (1480) can capture still images and videos. In one embodiment, the camera module (1480) may include one or more lenses, image sensors, image signal processors, or flashes.
[0199] The power management module (1488) can manage the power supplied to the electronic device (1401). According to one embodiment, the power management module (1488) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
[0200] A battery (1489) may power at least one component of the electronic device (1401). In one embodiment, the battery (1489) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0201] The communication module (1490) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (1401) and an external electronic device (e.g., electronic device (1402), electronic device (1404), or server (1408)), and the performance of communication through the established communication channel. The communication module (1490) may operate independently from the processor (1420) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (1490) may include a wireless communication module (1492) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (1494) (e.g., a local area network (LAN) communication module, or a power line communication module). Any of these communication modules may communicate with an external electronic device (1404) via a first network (1498) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (1499) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a local area network or a wide area network)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (1492) may use subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (1496) to verify or authenticate the electronic device (1401) within a communication network such as the first network (1498) or the second network (1499).
[0202] The wireless communication module (1492) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimizing terminal power and connecting multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency communications (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (1492) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (1492) may support various technologies for securing performance in high-frequency bands, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (1492) may support various requirements specified in the electronic device (1401), an external electronic device (e.g., the electronic device (1404)), or a network system (e.g., the second network (1499)). According to one embodiment, the wireless communication module (1492) may support a peak data rate (e.g., 20 Gbps or more) for eMBB implementation, a loss coverage (e.g., 164 dB or less) for mMTC implementation, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC implementation.
[0203] The antenna module (1497) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (1497) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (1497) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (1498) or the second network (1499), may be selected from the plurality of antennas by, for example, the communication module (1490). A signal or power may be transmitted or received between the communication module (1490) and the external electronic device via the selected at least one antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (1497).
[0204] According to various embodiments, the antenna module (1497) may form a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high frequency band.
[0205] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).
[0206] According to one embodiment, commands or data may be transmitted or received between the electronic device (1401) and an external electronic device (1404) via a server (1408) connected to a second network (1499). Each of the external electronic devices (1402 or 704) may be the same or a different type of device as the electronic device (1401). According to one embodiment, all or part of the operations executed in the electronic device (1401) may be executed in one or more of the external electronic devices (1402, 1404, or 708). For example, when the electronic device (1401) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (1401) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (1401). The electronic device (1401) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (1401) may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing. In one embodiment, the external electronic device (1404) may include an Internet of Things (IoT) device. The server (1408) may be an intelligent server utilizing machine learning and / or a neural network.According to one embodiment, an external electronic device (1404) or server (1408) may be included within the second network (1499). The electronic device (1401) may be applied to intelligent services (e.g., smart homes, smart cities, smart cars, or healthcare) based on 5G communication technology and IoT-related technology.
[0207] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.
[0208] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.
[0209] The term "module" used in various embodiments of this document may include a unit implemented in hardware, and may be used interchangeably with terms such as logic, block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0210] Various embodiments of the present document may be implemented as software (e.g., a program (1440)) including one or more instructions stored in a storage medium (e.g., an internal memory (1436) or an external memory (1438)) readable by a machine (e.g., an electronic device (1401)). For example, a processor (e.g., a processor (1420)) of the machine (e.g., an electronic device (1401)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.
[0211] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as a computer program product. The computer program product may be traded between sellers and buyers as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or may be provided through an application store (e.g., Play Store). TM ) or directly between two user devices (e.g., smart phones), online distribution (e.g., downloading or uploading). In the case of online distribution, at least a portion of the computer program product may be at least temporarily stored or temporarily created in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.
[0212] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separately arranged in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to integration. According to various embodiments, operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added. The electronic device (1401) of FIG. 14 may be an example of the electronic device (101) of FIGS. 1 and 2.
[0213] In one embodiment, a method for translating first text included in an electronic document may be required. When displaying an electronic document including second text in a second language, translated from a first text in a first language, a method for compensating for a difference in length between the first and second texts may be required. If the size of the second area of the electronic document where the second text is to be positioned is larger than the size of the first area of the electronic document where the first text is positioned, a method for preventing the second text from overlapping with content adjacent to the second text may be required. According to an embodiment as described above, an electronic device (e.g., electronic device (101) of FIG. 1 and / or FIG. 2, and / or electronic device (1401) of FIG. 14) may include a display (e.g., display (110) of FIG. 1 and / or FIG. 2), a memory (e.g., memory (220) of FIG. 2) including one or more storage media and storing instructions, and at least one processor (e.g., processor (210) of FIG. 2) including processing circuitry. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to receive an input for translating a first text in a first language (e.g., the first text (131) in FIG. 1 , the first text (410) in FIG. 4 ) contained in a first area (e.g., the first area (710) in FIG. 7A and / or FIG. 7B ) within an electronic document (e.g., the electronic document (130) in FIG. 1 ). The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to obtain, based on the input, a second text in a second language (e.g., the second text (151) in FIG. 1 , the second text (460) in FIG. 4 ) translated from the first text.The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to identify a size of an area for displaying the second text within the electronic document. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to identify a size of a second area within the electronic document (e.g., second area 760 of FIG. 7B ) that includes the first area within the electronic document and a first blank area within the electronic document, adjacent to the first area along a vertical direction of the electronic document, based on a size of the area that is greater than a size of the first area within the electronic document. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the electronic document including the second text in the second area that includes the first area and the first blank area. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along a horizontal direction of the electronic document, based on the size of the area being greater than the size of the second area. In one embodiment, the electronic device may translate the first text included in the electronic document. In one embodiment, the electronic device may compensate for a difference between lengths of the first text and the second text when displaying the electronic document including the second text in a second language, the second text being translated from the first text in a first language.When the size of the second area of the electronic document where the second text is to be positioned is larger than the size of the first area where the first text is to be positioned, the electronic device can prevent the second text from overlapping with content adjacent to the second text.
[0214] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to adjust an attribute of the second text in the second language such that the second text in the second language has an attribute different from the attribute of the first text, based on a size of the region that is greater than the size of the first region. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the second text in the second language having the adjusted attribute from a start position of the first region.
[0215] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to adjust the property of the second text by decreasing at least one of a font size and a line spacing.
[0216] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to obtain, based on receiving the input for translation of the first text, the first text including a first portion having a first font size and a second portion having a second font size smaller than the first font size, the second text including a third portion corresponding to the first portion and a fourth portion corresponding to the second portion. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to change the font size of the third portion to a third font size smaller than the first font size and larger than the second font size, based on identifying a size of the third portion within the second text that is larger than a size of the first portion expressed through the first area.
[0217] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to execute a translation function to obtain the second text using first data (e.g., first data (430) of FIG. 4) including the first text and a first tag indicative of an attribute of a portion of the first text. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to obtain, based on the translation function, second data (e.g., second data (440) of FIG. 4) including the second text and a second tag indicative of an attribute of a portion of the second text corresponding to the portion of the first text. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display, on the display, the second text having the attribute indicated by the second data.
[0218] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to identify a document object adjacent to the first area within the electronic document based on a size of the area being greater than the size of the first area. The instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to move the document object within the electronic document such that a distance between the document object and the first area increases.
[0219] For example, the instructions, when individually or collectively executed by the at least one processor, may cause the electronic device to display the electronic document, including the second text, in the area starting from a start position of the first area and having the identified size, based on the size of the area being smaller than the size of the first area.
[0220] In one embodiment, as described above, a non-transitory computer-readable storage medium storing instructions may be provided. The instructions, when executed by an electronic device including a display, may cause the electronic device to receive an input for translating a first text in a first language contained in a first area within an electronic document. The instructions, when executed by the electronic device, may cause the electronic device to obtain a second text in a second language translated from the first text based on the input. The instructions, when executed by the electronic device, may cause the electronic device to identify a size of an area within the electronic document for displaying the second text. The instructions, when executed by the electronic device, may cause the electronic device to identify a size of the first area within the electronic document, based on a size of the area that is greater than a size of the first area within the electronic document, and a size of a second area within the electronic document, the second area including a first blank area within the electronic document, adjacent to the first area along a vertical direction of the electronic document. The instructions, when executed by the electronic device, may cause the electronic device to display the electronic document including the second text in the second area, the second area including the first area and the first blank area, based on a size of the area that is less than the size of the second area.Based on the size of the area smaller than the size of the second area, based on the size of the area larger than the size of the second area, in the first area, and in a third area within the electronic document, including a second blank area within the electronic document adjacent to the first area along the horizontal direction of the electronic document, the electronic document including the second text can be caused to be displayed.
[0221] For example, the instructions, when executed by the electronic device, may cause the electronic device to adjust an attribute of the second text in the second language such that the second text in the second language has an attribute different from the attribute of the first text, based on a size of the region that is greater than the size of the first region. The instructions, when executed by the electronic device, may cause the electronic device to display the second text in the second language having the adjusted attribute from a start position of the first region.
[0222] For example, the instructions, when executed by the electronic device, may cause the electronic device to adjust the property of the second text by decreasing at least one of a font size and a line spacing.
[0223] For example, the instructions, when executed by the electronic device, may cause the electronic device to obtain, based on receiving the input for translation of the first text, the first text including a first portion having a first font size and a second portion having a second font size smaller than the first font size, the second text including a third portion corresponding to the first portion and a fourth portion corresponding to the second portion. The instructions, when executed by the electronic device, may cause the electronic device to change the font size of the third portion to a third font size smaller than the first font size and larger than the second font size, based on identifying a size of the third portion within the second text that is larger than a size of the first portion expressed through the first area.
[0224] For example, the instructions, when executed by the electronic device, may cause the electronic device to execute a translation function to obtain the second text using the first data, the first data including the first text and a first tag indicative of an attribute of a portion of the first text. The instructions, when executed by the electronic device, may cause the electronic device to obtain, based on the translation function, second data, the second data including the second text and a second tag indicative of an attribute of a portion of the second text corresponding to the portion of the first text. The instructions, when executed by the electronic device, may cause the electronic device to display, on the display, the second text having the attribute indicated by the second data.
[0225] For example, the instructions, when executed by the electronic device, may cause the electronic device to identify a document object adjacent to the first area within the electronic document based on a size of the area being greater than the size of the first area. The instructions may cause the electronic device to move the document object within the electronic document such that the distance between the document object and the first area increases.
[0226] For example, the instructions, when executed by the electronic device, may cause the electronic device to display the electronic document, including the second text, in the area starting from a start position of the first area and having the identified size, based on the size of the area being smaller than the size of the first area.
[0227] As described above, in one embodiment, a method of an electronic device including a display may be provided. The method may include receiving an input for translating a first text in a first language, the first text included in a first area within an electronic document. The method may include obtaining a second text in a second language, translated from the first text, based on the input. The method may include identifying a size of an area for displaying the second text within the electronic document. The method may include identifying a size of a second area within the electronic document, the second area including the first area within the electronic document and a first blank area within the electronic document adjacent to the first area along a vertical direction of the electronic document, based on a size of the area being larger than the size of the first area within the electronic document. The method may include displaying the electronic document including the second text in the second area including the first area and the blank area, based on a size of the area being smaller than the size of the second area. The method may include an operation of displaying the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along a horizontal direction of the electronic document, based on the size of the area being greater than the size of the second area.
[0228] For example, the method may include an operation of adjusting an attribute of the second text of the second language so that the second text of the second language has an attribute different from the attribute of the first text, based on a size of the region that is larger than the size of the first region. The method may include an operation of displaying the second text of the second language having the adjusted attribute from a start position of the first region.
[0229] For example, the action of adjusting the property may include an action of adjusting the property of the second text by reducing at least one of a font size and a line spacing.
[0230] For example, the act of adjusting the property may include an act of obtaining a second text including a third portion corresponding to the first portion and a fourth portion corresponding to the second portion, based on receiving an input for translation of the first text including a first portion having a first font size and a second portion having a second font size smaller than the first font size. The act of adjusting the property may include an act of changing a font size of the first portion to a third font size smaller than the first font size and larger than the second font size, based on identifying a size of the third portion within the second text that is larger than a size of the first portion expressed through the first area.
[0231] For example, the obtaining operation may include an operation of executing a translation function for obtaining the second text using first data including the first text and a first tag indicating an attribute of a portion of the first text. The obtaining operation may include an operation of obtaining, based on the translation function, second data including the second text and a second tag indicating an attribute of a portion of the second text corresponding to the portion of the first text. The displaying operation of the electronic document including the second text may include an operation of displaying, on the display, the second text having the attribute indicated by the second data.
[0232] For example, the method may include an operation of identifying a document object adjacent to the first area within the electronic document based on a size of the area that is greater than the size of the first area. The method may include an operation of moving the document object within the electronic document such that the distance between the document object and the first area increases.
[0233] For example, the moving operation may include an operation of identifying a location of the document object within a virtual page within the electronic document, the virtual page including the first region and the document object. The moving operation may include an operation of increasing a size of the virtual page based on identifying that at least a portion of the document object has been moved out of the virtual page. The moving operation may include an operation of adding another virtual page after the virtual page within the electronic document based on identifying that at least a portion of the document object has been moved out of the virtual page. The moving operation may include an operation of moving the document object to the other virtual page.
[0234] As used herein, the term "if" will be understood to mean "when, upon," "in response to determining," or "in response to detecting," depending on the context. Similarly, "if it is determined to," or "if [the stated condition or event] is detected," will optionally be understood to mean "upon determining," or "in response to determining," "upon detecting [the stated condition or event]," or "in response to detecting [the stated condition or event]."
[0235] The devices described above may be implemented as hardware components, software components, and / or a combination of hardware components and software components. For example, the devices and components described in the embodiments may be implemented using one or more general-purpose computers or special-purpose computers, such as a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), a programmable logic unit (PLU), a microprocessor, or any other device capable of executing instructions and responding to them. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to the execution of the software. For ease of understanding, the processing device is sometimes described as being used alone; however, one of ordinary skill in the art will recognize that the processing device may include multiple processing elements and / or multiple types of processing elements. For example, a processing unit may include multiple processors, or a processor and a controller. Other processing configurations, such as parallel processors, are also possible.
[0236] Software may include a computer program, code, instructions, or a combination of one or more of these, which may configure a processing device to perform a desired operation or may independently or collectively command the processing device. The software and / or data may be embodied in any type of machine, component, physical device, computer storage medium, or device for interpretation by the processing device or for providing instructions or data to the processing device. The software may also be distributed over networked computer systems and stored or executed in a distributed manner. The software and data may be stored on one or more computer-readable recording media.
[0237] The method according to the embodiment may be implemented in the form of program commands that can be executed through various computer means and recorded on a computer-readable medium. In this case, the medium may be one that continuously stores a computer-executable program or one that temporarily stores it for execution or download. In addition, the medium may be various recording means or storage means in the form of a single or multiple hardware combinations, and is not limited to a medium directly connected to a computer system, but may also be distributed over a network. Examples of the medium may include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and those configured to store program commands, including ROM, RAM, and flash memory. In addition, examples of other media may include recording media or storage media managed by app stores that distribute applications, sites that supply or distribute various software, servers, etc.
[0238] Although the embodiments described above have been described by way of limited examples and drawings, those skilled in the art will appreciate that various modifications and variations can be made based on the above teachings. For example, appropriate results can still be achieved even if the described techniques are performed in a different order than described, and / or components of the described systems, structures, devices, circuits, etc. are combined or combined in a different manner than described, or are replaced or substituted with other components or equivalents.
[0239] Therefore, other implementations, other embodiments, and equivalents to the claims also fall within the scope of the claims described below. < / red> < / text>
Claims
1. In electronic devices, display; A memory including one or more storage media for storing instructions; and comprising at least one processor, comprising a processing circuit; The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Receiving input for translation of a first text in a first language contained within a first area within an electronic document; Based on the above input, a second text in a second language translated from the first text is obtained; Within the electronic document, identify the size of an area for displaying the second text; Identifying a size of a second area within the electronic document, the second area including the first area within the electronic document and a first blank area within the electronic document, the first area being adjacent to the first area along a vertical direction of the electronic document, based on the size of the area being larger than the size of the first area within the electronic document; Displaying the electronic document including the second text in the second area including the first area and the first blank area based on the size of the area smaller than the size of the second area; and Causing to display the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along the horizontal direction of the electronic document, based on the size of the area larger than the size of the second area. Electronic devices.
2. In claim 1, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Adjusting the properties of the second text of the second language so that the second text of the second language has properties different from the properties of the first text based on the size of the area that is larger than the size of the first area; and causing the second text of the second language having the adjusted property to be displayed from the start position of the first area, Electronic devices.
3. In claim 2, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: causing said second text to adjust said properties by reducing at least one of font size and line spacing; Electronic devices.
4. In claim 2, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Based on receiving the input for translation of the first text, which includes a first portion having a first font size and a second portion having a second font size smaller than the first font size, obtaining the second text, which includes a third portion corresponding to the first portion and a fourth portion corresponding to the second portion; Based on identifying a size of the third portion within the second text that is larger than the size of the first portion expressed through the first area: Causing the font size of the third part to be changed to a third font size that is smaller than the first font size and larger than the second font size, Electronic devices.
5. In claims 1 to 4, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Execute a translation function to obtain the second text using the first data including the first text and a first tag representing an attribute of a part of the first text; Based on the above translation function, obtain second data including a second tag indicating an attribute of a part of the second text corresponding to the part of the first text and the second text; and Causing the second text having the property indicated by the second data to be displayed on the display, Electronic devices.
6. In claims 1 to 5, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Identifying a document object adjacent to the first area within the electronic document based on a size of the area greater than the size of the first area; and causing the document object to move within the electronic document so that the distance between the document object and the first area increases; Electronic devices.
7. In claims 1 to 6, The above instructions, when individually or collectively executed by the at least one processor, cause the electronic device to: Causing the electronic document to be displayed, including the second text, in the area starting from the start position of the first area and having the identified size, based on the size of the area smaller than the size of the first area. Electronic devices.
8. In a non-transitory computer-readable storage medium storing instructions, the instructions, when executed by an electronic device including a display, cause the electronic device to: Receiving input for translation of a first text in a first language contained within a first area within an electronic document; Based on the above input, a second text in a second language translated from the first text is obtained; Within the electronic document, identify the size of an area for displaying the second text; Identifying a size of a second area within the electronic document, the second area including the first area within the electronic document and a first blank area within the electronic document, the first area being adjacent to the first area along a vertical direction of the electronic document, based on the size of the area being larger than the size of the first area within the electronic document; Displaying the electronic document including the second text in the second area including the first area and the first blank area based on the size of the area smaller than the size of the second area; and Causing to display the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along the horizontal direction of the electronic document, based on the size of the area larger than the size of the second area. Non-transitory computer-readable storage medium.
9. In claim 8, The above instructions, when executed by the electronic device, cause the electronic device to: Adjusting the properties of the second text of the second language so that the second text of the second language has properties different from the properties of the first text based on the size of the area that is larger than the size of the first area; and causing the second text of the second language having the adjusted property to be displayed from the start position of the first area, Non-transitory computer-readable storage medium.
10. In claim 9, The above instructions, when executed by the electronic device, cause the electronic device to: causing said second text to adjust said properties by reducing at least one of font size and line spacing; Non-transitory computer-readable storage medium.
11. In claim 9, The above instructions, when executed by the electronic device, cause the electronic device to: Based on receiving the input for translation of the first text, which includes a first portion having a first font size and a second portion having a second font size smaller than the first font size, obtaining the second text, which includes a third portion corresponding to the first portion and a fourth portion corresponding to the second portion; Based on identifying a size of the third portion within the second text that is larger than the size of the first portion expressed through the first area: Causing the font size of the third part to be changed to a third font size that is smaller than the first font size and larger than the second font size, Non-transitory computer-readable storage medium.
12. In claims 8 to 11, The above instructions, when executed by the electronic device, cause the electronic device to: Execute a translation function to obtain the second text using the first data including the first text and a first tag representing an attribute of a part of the first text; Based on the above translation function, obtain second data including a second tag indicating an attribute of a part of the second text corresponding to the part of the first text and the second text; and Causing the second text having the property indicated by the second data to be displayed on the display, Non-transitory computer-readable storage medium.
13. In claims 8 to 12, The above instructions, when executed by the electronic device, cause the electronic device to: Identifying a document object adjacent to the first area within the electronic document based on a size of the area greater than the size of the first area; and causing the document object to move within the electronic document so that the distance between the document object and the first area increases; Non-transitory computer-readable storage medium.
14. In claims 8 to 13, The above instructions, when executed by the electronic device, cause the electronic device to: Causing the electronic document to be displayed, including the second text, in the area starting from the start position of the first area and having the identified size, based on the size of the area smaller than the size of the first area. Non-transitory computer-readable storage medium.
15. A method of an electronic device including a display, An act of receiving input for translation of a first text in a first language contained within a first area within an electronic document; An operation of obtaining a second text in a second language translated from the first text based on the above input; An action of identifying the size of an area for displaying the second text within the electronic document; An operation of identifying a size of a second area within the electronic document, the second area including the first area within the electronic document and a first blank area within the electronic document, the first area being adjacent to the first area along a vertical direction of the electronic document, based on the size of the area being larger than the size of the first area within the electronic document; An operation of displaying the electronic document including the second text in the second area including the first area and the blank area based on the size of the area smaller than the size of the second area; and An operation of displaying the electronic document including the second text in a third area within the electronic document, the third area including the first area and a second blank area within the electronic document adjacent to the first area along the horizontal direction of the electronic document, based on the size of the area being larger than the size of the second area, method.
Citation Information
Patent Citations
Electronic document creation system, and program
JP2015204075A
Writing conversion device, conversion display device, conversion display system, control method, and recording medium
JP2020003892A
Translation display device
JP2918114B2
Rendering a text image following a line
KR1020140073480A
A method and an apparatus for creating translated images while maintaining the style of text
KR102586180B1