The present invention relates to word processing programs and in particular to style sheets used in word processing programs.
Documents created using current word processors, e.g., Microsoft Word or OpenOffice, often contain a variety of styles within a single document. In general, a style is a set of attributes that characterize how characters in a document should be formatted. The word processors utilize two main approaches to manage these various styles within a single document. The first approach is to use named styles. A named style is a set of attributes collected together such that all the attributes can be applied to the characters of a selected region at the same time with a single gesture. In addition, the set of attributes typically has an abstract name, for example “Heading”, that refers to the purpose of the style sheet rather than the visual characteristics of the style. With the named styles approach, a user can select a region of text and apply a named style, e.g., “Heading” or “Body text”, to all text located within that region. The style defines the characteristics of the text including the font and other attributes. For example, the style “Heading” can be defined as Helvetica 24 point bold or Times 10 point regular. Changes to a given named style affect the text in all regions within a document that have been assigned to that style, and a given word processing program provides the necessary interfaces to change the style attributes of each named style. The use of named styles provides the benefit of using a single action to effect changes consistently across the entire document.
The second approach to styling a document is to use direct or manual manipulation to create adhoc styles. In this approach, a user selects a region of text and manually sets the style of the text within the selected region using the affordances provided by the word processor to choose the font face, size, obliqueness and other factors. Most users are familiar with the direct manipulation approach and, therefore, are most likely to use this approach to implement the desired styles within a given document. However, the direct manipulation approach has the drawback that users wishing to make a consistent change must repetitively select each region of the document and apply the desired style separately to each selected region. This practice is laborious, time-consuming and error-prone and results in a variety of adhoc styles being applied across the document. The use of adhoc styles makes it difficult to keep styles consistent across a document. For instance, if the user wants to make all headings bold 16-pt Arial text, the user must laboriously search through the document, locate each instance of the desired heading, and manually apply the desired style. If the user had employed named styles, the same modification could have been made by making a single change to the named style.
Although named styles make style formatting easier and more consistent, they present a level of abstraction that many users find difficult to master, because named styles are one level removed from the familiar direct-manipulation user interface. Therefore, named styles can be difficult to use, and very few users are capable of using them effectively. The use of named styles also presents issues during cut and paste and document merging. For example, merging multiple documents from different sources introduces style inconsistencies into a single merged document. Each merged document can have a different set of named styles. For example, the style for the majority of plain text in a document might be named “Body Text” style in one document and “Plain Text” style in another document. Furthermore, those two styles might have different characteristics, for example a different font size.
The deficiencies in both the named style and the adhoc style approach result in documents that have inconsistent styles. Because of these inconsistencies, documents may not have a uniform appearance, and the document becomes difficult to modify as changes made in one section of the document must be manually repeated for the remaining sections.
Systems and methods in accordance with exemplary embodiments of the present invention provide for the styling of text, for example setting font size, font style and other features, in a word processing program such as Microsoft Word or OpenOffice, in a presentation program such as Microsoft Powerpoint or in any type of document editor that allows users to edit formatted test with a multitude of styles. A given document is scanned and partitioned into style regions having identical styles.
In one embodiment, a similarity-based match such as automated clustering is used to group together similar style regions to form logical style groups. Therefore, two regions that are similar in style can be identified and placed into the same style group. For example, one region can be using a 17 point font and the other region can be using an 18 point font for a heading. Similarity matching can be based on the features of the style, for example point size, or on similar contents of the text, for example “Section 1: Introduction” and “Section 2: Motivation”.
In one embodiment, each logical style group is mapped to one of the existing named styles in the document, and all style regions in the style group are converted to instances of the named style. Thus the text of a given document is converted from multiple, visually-similar but distinct styles that had been directly-applied or merged into the document into a smaller number of named styles. The system for automatic style inference examines the styles present in a document, detects regions where the styles are similar or identical and automatically converts from the manually-applied styles to a single, consistent, named style for those regions. Using this invention, the system could provide a “style cleanup” feature that identifies all instances of the “bold, 15 or 16 point Arial” styles and converts then to the “Heading 1” named style.
In one embodiment, a new named style is created for each logical style group. This can be done, for example, by averaging the styles in the style group and using the most common style as the basis for the new named style. In this way, the document is not required to include a pre-existing set of named styles in order to benefit from this invention.
In one embodiment, a user interface is provided to allow the user to confirm or override the style grouping. For example, after the document has been partitioned and style groups identified, a user can be prompted to increase or decrease the number of identified groups or to change the assignment of regions to groups. This allows the user to override the system's automatically-generated style mapping.
Systems and methods in accordance with the present invention simplify management of document formatting. Inconsistencies in style, for example where two regions look the same but are subtly different, are identified and corrected since these inconsistencies can cause problems in the future as the styles are modified. Common styles are inferred or applied to a given document automatically even though the styles in the document may have been applied individually in a manual fashion.
Referring initially to
The scanned text within the document has associated style attributes. These style attributes include, but are not limited to, font type, font size, font style, font face, font family, line spacing, letter spacing, paragraph alignments and other characteristics of the styling of text. In one embodiment, one or more style attributes associated with the scanned text is identified 16. In one embodiment, each style attribute is treated or weighted equally, and the scanned text is identified by all of the identified style attributes. These identified style attributes, however, can vary from section of text to section of text throughout the scanned document. Alternatively, the style attributes are not weighted equally. In one embodiment, the style attributes are given different weights. In one embodiment, a given section of text is identified using only a subset of the style attributes associated with the text. For example, style attributes such as font type and font size can be primary style attributes, and style attributes such as font style, superscript and subscript can be secondary style attributes. In one embodiment, sections of scanned text are only identified based upon primary style attributes. This embodiment would not define text based upon style attributes such as italics, superscript, subscript or strikethrough, and these style attributes would remain unchanged upon any subsequent modification or homogenization of the text. This embodiment accounts for single italicized words in a line of text and other similar style anomalies. Alternatively, both primary and secondary style attributes are associated with and used to define a given section of text. The weight to be given to the various style attributes is determined later in the process and can involve user input.
Having scanned the document and identified the style attributes throughout the scanned text, these identified style attributes are to identify style regions 18. As used herein, style regions refer to sections or regions of text, tables and graphics within the document that contain consistent or substantially uniform styling. In identifying style regions, style consistency is applied internally to the style region itself, i.e., the style of a given style region is internally consistent. In one embodiment, a style region represents continuous or contiguous text. For example, a style region is identified that correlates to a heading within the document. Alternatively, one or more continuous paragraphs of text where all of the text within those paragraphs has a consistent style are identified as a style region. Style regions can be multiple paragraphs or pages of text or can be a single line of text, a single sentence, a single word or a single letter. The identification of style regions produces at least one and potentially a plurality of distinct identified style regions for a given document.
In one embodiment, identification of uniform style regions includes identifying a set of style attributes for each identified style region. Each set of style attributes includes at least one and preferably of plurality of style attributes of the style region with which it is associated. In one embodiment, this set of style attributes takes the form of an attribute style vector. Referring to
Returning to
In one embodiment, correspondence among the style attributes of each identified style region in a given style group is achieved when the associated style attributes of each style region within the style group are substantially identical as opposed to being exactly identical. In one embodiment, a content-based matching approach is used to establish correspondence among style regions that are substantially identical. The content-based approach analyzes the actual content of the text or characters in each identified style region. Therefore, each region with the content “Chapter” followed by an alpha-numeric indicator would be substantially identical. Alternatively, a style-based matching approach is used to establish correspondence among style regions that are substantially identical. The style-based matching approach utilizes either acceptable variances in the value of a given style attribute or a set of acceptable values for a given style attribute for one or more of the style attributes. For example, the style attribute font type is represented by the set containing the values “Times” and “Times New Roman”, and the style attribute font size includes the font sizes within 2 points of each other. Therefore, style regions having an associated font type either Times or Times New Roman and a font size in the range from 10 point to 12 point are included in the group of substantially identical style regions based upon a style-based approach.
Referring again to
Returning to
Referring to
As shown in
As illustrated in
If a corresponding pre-defined named style does not exist for the style group, a new named style is created or extracted from the style attributes of the style regions within the style group 25. In one embodiment, the style attribute sets associated with the style regions contained in the style group are combined to generate a named style sheet for each style group including common style groups. Again, the style attributes associated with each style region within each style group are modified to be identical to the style attributes of the new named style generated from each style group 27. Therefore, named styles are applied uniformly and consistently across various documents.
In one embodiment, the style attributes of mapped regions, whether mapped individually or in groups, are modified in accordance with the style attributes of the pre-defined style sheets such that certain style attributes are not changed. For example, only primary style attributes are changed and not secondary style attributes. Therefore, highlights in the text such as small groups of words or phrases that are highlighted, italicized or underlined are not removed through the modification process. In one embodiment this is accomplished automatically through the definition or parameters established with the modification process. In one embodiment, these anomalous stylings within a region are handled manually by utilizing user input. For example, during the process of modification, the user can be prompted to confirm, ignore or determine the action to take with regards to an anomalous section of text within a given region. Suitable types of user interfaces include, for example, the type of user input that is provided in spelling and grammar check routines used in word processing programs. In addition, user input can be provided to affirm the groupings of style regions or the application of style attributes to a given style group. User input can be user initiated or can be in response to a prompt from the system. In addition, user input can be provided to clarify questions or close calls in identifying regions, characteristics and styles.
Referring to
In one embodiment, exemplary methods in accordance with the present invention are used to apply named styles to a plurality of documents. Therefore documents that have been prepared by different users or by different programs, i.e. word processing programs and presentation programs, can have common named styles applied to all of the documents. This common or universal style formatting is useful when the various documents are combined, for example, for a common presentation, publication or archiving. The common named styles can be extracted from the existing style attributes of the various documents or can be provided through mapping to pre-defined named styles. In one embodiment, the plurality of documents is scanned, either in serially or in parallel, and one or more style regions are identified within each one of the plurality of documents. As with the single document, preferably a single scanning pass is made. The scanning and identification techniques are the same as for the single document embodiment; however, style regions are identified simultaneously in all of the scanned documents. The style regions, while coming from different documents, are treated together for purposes of grouping and mapping. Each style region represents a section of text having uniform style attributes, one or more style attributes associated with each identified style region are identified.
The identified style attributes are used to group the identified style regions of each document into one or more style groups. The style groups represent groups of style regions having similar style attributes even though the actual regions may be associated with different documents. Therefore, a given style group can span two or more documents. In addition, style groups can exist that contain style regions associated with only a single document in the plurality of documents. In one embodiment, style groups common to two or more documents from the identified style groups can be identified. In one embodiment, each style group, including style groups related to a single document and style groups covering style regions of two or more documents are mapped to one of a plurality of pre-defined named styles. Each named style contains a plurality of pre-defined style attributes. Having mapped the style groups to named styles, style attributes associated with each style region associated with a given style group including style groups common to two or more documents are modified to be identical to the pre-defined style attributes of the named style to which the style group has been mapped.
Methods and systems in accordance with exemplary embodiments of the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software and microcode. In addition, exemplary methods and systems can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer, logical processing unit or any instruction execution system. For the purposes of this description, a computer-usable or computer-readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. Suitable computer-usable or computer readable mediums include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems (or apparatuses or devices) or propagation mediums. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
Suitable data processing systems for storing and/or executing program code include, but are not limited to, at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements include local memory employed during actual execution of the program code, bulk storage, and cache memories, which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution. Input/output or I/O devices, including but not limited to keyboards, displays and pointing devices, can be coupled to the system either directly or through intervening I/O controllers. Exemplary embodiments of the methods and systems in accordance with the present invention also include network adapters coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Suitable currently available types of network adapters include, but are not limited to, modems, cable modems, DSL modems, Ethernet cards and combinations thereof.
In one embodiment, the present invention is directed to a machine-readable or computer-readable medium containing a machine-executable or computer-executable code that when read by a machine or computer causes the machine or computer to perform a method for applying named styles to documents in accordance with exemplary embodiments of the present invention and to the computer-executable code itself. The machine-readable or computer-readable code can be any type of code or language capable of being read and executed by the machine or computer and can be expressed in any suitable language or syntax known and available in the art including machine languages, assembler languages, higher level languages, object oriented languages and scripting languages. The computer-executable code can be stored on any suitable storage medium or database, including databases disposed within, in communication with and accessible by computer networks utilized by systems in accordance with the present invention and can be executed on any suitable hardware platform as are known and available in the art including the control systems used to control the presentations of the present invention.
While it is apparent that the illustrative embodiments of the invention disclosed herein fulfill the objectives of the present invention, it is appreciated that numerous modifications and other embodiments may be devised by those skilled in the art. Additionally, feature(s) and/or element(s) from any embodiment may be used singly or in combination with other embodiment(s) and steps or elements from methods in accordance with the present invention can be executed or performed in any suitable order. Therefore, it will be understood that the appended claims are intended to cover all such modifications and embodiments, which would come within the spirit and scope of the present invention.