TEXT SELECTION PARAGRAPH SNAPPING

Aspects of the subject matter described herein relate to paragraph snapping. In aspects, a computing device receives user input regarding a selection of text. If the user input is expansion input, the computing device determines whether a set of one or more paragraph snapping conditions is satisfied. If the set of one or more paragraph snapping conditions is satisfied, the selection is snapped to the paragraph. If the user input is contraction input, the selection is shrunk and the paragraph snapping behavior is turned off for the paragraph until the selection activity is finished or until user input indicates that paragraph snapping behavior is to be re-enabled.

DETAILED DESCRIPTION

Definitions

As used herein, the term “includes” and its variants are to be read as open-ended terms that mean “includes, but is not limited to.” The term “or” is to be read as “and/or” unless the context clearly dictates otherwise. The term “based on” is to be read as “based at least in part on.” The terms “one embodiment” and “an embodiment” are to be read as “at least one embodiment.” The term “another embodiment” is to be read as “at least one other embodiment.”

As used herein, terms such as “a,” “an,” and “the” are inclusive of one or more of the indicated item or action. In particular, in the claims a reference to an item generally means at least one such item is present and a reference to an action means at least one instance of the action is performed.

Sometimes herein the terms “first”, “second”, “third” and so forth may be used. Without additional context, the use of these terms in the claims is not intended to imply an ordering but is rather used for identification purposes. For example, the phrases “first version” and “second version” do not necessarily mean that the first version is the very first version or was created before the second version or even that the first version is requested or operated on before the second version. Rather, these phrases are used to identify different versions.

Other definitions, explicit and implicit, may be included below.

Exemplary Operating Environment

Aspects of the subject matter described herein are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments, or configurations that may be suitable for use with aspects of the subject matter described herein comprise personal computers, server computers—whether on bare metal or as virtual machines—, hand-held or laptop devices, multiprocessor systems, microcontroller-based systems, set-top boxes, programmable and non-programmable consumer electronics, network PCs, minicomputers, mainframe computers, personal digital assistants (PDAs), gaming devices, printers, appliances including set-top, media center, or other appliances, automobile-embedded or attached computing devices, other mobile devices, phone devices including cell phones, wireless phones, and wired phones, distributed computing environments that include any of the above systems or devices, and the like. While various embodiments may be limited to one or more of the above devices, the term computer is intended to cover the devices above unless otherwise indicated.

With reference toFIG. 1, an exemplary system for implementing aspects of the subject matter described herein includes a general-purpose computing device in the form of a computer110. A computer may include any electronic device that is capable of executing an instruction. Components of the computer110may include a processing unit120, a system memory130, and one or more system buses (represented by system bus121) that couples various system components including the system memory to the processing unit120. The system bus121may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, Peripheral Component Interconnect (PCI) bus also known as Mezzanine bus, Peripheral Component Interconnect Extended (PCI-X) bus, Advanced Graphics Port (AGP), and PCI express (PCIe).

The processing unit120may be connected to a hardware security device122. The security device122may store and be able to generate cryptographic keys that may be used to secure various aspects of the computer110. In one embodiment, the security device122may comprise a Trusted Platform Module (TPM) chip, TPM Security Device, or the like.

The computer110typically includes a variety of computer-readable media. Computer-readable media can be any available media that can be accessed by the computer110and includes both volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media.

The computer110may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only,FIG. 1illustrates a hard disk drive141that reads from or writes to non-removable, nonvolatile magnetic media, a magnetic disk drive151that reads from or writes to a removable, nonvolatile magnetic disk152, and an optical disc drive155that reads from or writes to a removable, nonvolatile optical disc156such as a CD ROM, DVD, or other optical media. Other removable/non-removable, volatile/nonvolatile computer storage media that can be used in the exemplary operating environment include magnetic tape cassettes, flash memory cards and other solid state storage devices, digital versatile discs, other optical discs, digital video tape, solid state RAM, solid state ROM, and the like. The hard disk drive141may be connected to the system bus121through the interface140, and magnetic disk drive151and optical disc drive155may be connected to the system bus121by an interface for removable nonvolatile memory such as the interface150.

The drives and their associated computer storage media, discussed above and illustrated inFIG. 1, provide storage of computer-readable instructions, data structures, program modules, and other data for the computer110. InFIG. 1, for example, hard disk drive141is illustrated as storing operating system144, application programs145, other program modules146, and program data147. Note that these components can either be the same as or different from operating system134, application programs135, other program modules136, and program data137. Operating system144, application programs145, other program modules146, and program data147are given different numbers herein to illustrate that, at a minimum, they are different copies.

A user may enter commands and information into the computer110through input devices such as a keyboard162and pointing device161, commonly referred to as a mouse, trackball, or touch pad. Other input devices (not shown) may include a microphone (e.g., for inputting voice or other audio), joystick, game pad, satellite dish, scanner, a touch-sensitive screen, a writing tablet, a camera (e.g., for inputting gestures or other visual input), or the like. These and other input devices are often connected to the processing unit120through a user input interface160that is coupled to the system bus, but may be connected by other interface and bus structures, such as a parallel port, game port or a universal serial bus (USB).

Through the use of one or more of the above-identified input devices a Natural User Interface (NUI) may be established. A NUI, may rely on speech recognition, touch and stylus recognition, gesture recognition both on screen and adjacent to the screen, air gestures, head and eye tracking, voice and speech, vision, touch, gestures, machine intelligence, and the like. Some exemplary NUI technology that may be employed to interact with a user include touch sensitive displays, voice and speech recognition, intention and goal understanding, motion gesture detection using depth cameras (such as stereoscopic camera systems, infrared camera systems, RGB camera systems, and combinations thereof), motion gesture detection using accelerometers/gyroscopes, facial recognition, 3D displays, head, eye, and gaze tracking, immersive augmented reality and virtual reality systems, as well as technologies for sensing brain activity using electric field sensing electrodes (EEG and related methods).

A monitor191or other type of display device is also connected to the system bus121via an interface, such as a video interface190. In addition to the monitor, computers may also include other peripheral output devices such as speakers197and printer196, which may be connected through an output peripheral interface195.

Paragraph Snapping

As mentioned previously, precise selection of text may be challenging with certain types of devices.FIGS. 2-4are block diagrams of exemplary user interfaces in accordance with aspects of the subject matter described herein. Each user interface may include one or more elements. In general, an element (sometimes called a control) may be composed of zero or more other elements. For example, an element may include zero or more other elements which may include zero or more other elements and so forth. Furthermore, it will be recognized, that a user interface may have more, fewer, or other elements which may be arranged in a variety of ways without departing from the spirit or scope of the subject matter described herein.

Turning toFIG. 2, in one example, a window200may include a menu205and a pane315which are each elements of a user interface. The window200may also include other elements not shown.

As shown inFIG. 2, the menu205may include menu items such a file, edit, view, and other menu items as desired. Selecting a menu item may cause a submenu to appear which provides additional menu items to select from. Menu items in a submenu may cause additional submenus to appear and so forth.

The pane215may display one or more paragraphs of text. As illustrated, the pane215includes2paragraphs of text (e.g., paragraphs220and225). A user may select text from the window200using traditional user input devices (e.g., mouse, keyboard, and the like) or any type of Natural User Interface (NUI), which has been described previously. For example, when the window200is displayed on a touch sensitive screen, the user may, in one embodiment, select a word by tapping a finger on the area corresponding to the selection230.

Although a touch sensitive screen and user interaction regarding touching are sometimes mentioned herein, there is no intention to limit user input to these types of interactions. Where these types of interactions are described, it is to be understood that in other embodiments, other user input interactions may be substituted that are functionally equivalent to the user interactions described. Thus, user input that involves touching a touch sensitive screen and dragging a finger along the screen may be performed, in other embodiments, through the use of traditional input devices and/or through the use of a NUI.

After the user has selected a word (or indicated the starting point of a selection), the user may begin expanding the selection230by providing expansion input. For example, with a touch sensitive screen, the user may touch with a finger close to a handle (not shown) on the right side of the selection230and may begin dragging the finger to the right and/or down on the touch sensitive screen. As the user drags a finger, the selection230may expand to identify text that is now part of the selection230.

As another example, with a touch sensitive screen, the user may touch with a finger close to a handle (not shown) on the left side of the selection230and may begin dragging the finger to the left and/or up on the touch sensitive screen. As the user drags a finger, the selection230may expand to identify text that is now part of the selection230.

Paragraph snapping actions may occur as described below in conjunction withFIGS. 5-6.FIGS. 5-6are flow diagrams that generally represent exemplary actions that may occur in accordance with aspects of the subject matter described herein. For simplicity of explanation, the methodology described in conjunction withFIGS. 5-6is depicted and described as a series of acts. It is to be understood and appreciated that aspects of the subject matter described herein are not limited by the acts illustrated and/or by the order of acts. In one embodiment, the acts occur in an order as described below. In other embodiments, however, two or more of the acts may occur in parallel or in another order. In other embodiments, one or more of the actions may occur with other acts not presented and described herein. Furthermore, not all illustrated acts may be required to implement the methodology in accordance with aspects of the subject matter described herein. In addition, those skilled in the art will understand and appreciate that the methodology could alternatively be represented as a series of interrelated states via a state diagram or as events.

Turning toFIG. 5, at block505, the actions begin. At block510, an indication of a selection is received. For example, referring toFIG. 2, a user may touch a touch sensitive device near the word in the area corresponding to the selection230. In one example, touching the area may cause a word (e.g., the word within the selection230) to be selected. In another example, touching the touch sensitive device in proximity to the area may cause a line, pointer, handle, inverted text, or some other indication that indicates a start or end of a selection.

At block515, expansion input is received with respect to the selection. For example, referring toFIG. 2, a user may provide expansion input by dragging a finger to the right and/or down from the selection230. In the English language, a person normally reads from left to right and from the top of a page to the bottom of the page. In other languages, a person may read from right to left and from the top of the page to the bottom of the page. This is sometimes referred to herein as reading in the direction of text flow and may include other combinations than mentioned above. Expansion input includes input in the direction of text flow and may depend on the language in which the text is written.

Expansion input may also include input in a direction opposite of text flow. For example, a user may provide expanding input by placing a finger on the start of the selection230and dragging the finger to the left and/or up from the selection230.

At block520, the selection is resized in accordance with the expansion input. For example, referring toFIGS. 2 and 3, in response to a user dragging a finger downward, the selection230may be resized to the selection330.

At block525, if the selection as resized satisfies a set of one or more paragraph snapping conditions, the actions continue at block530; otherwise, the actions continue at block540. Below are indicated some exemplary paragraph snapping conditions. The examples below are not intended to be all-inclusive or exhaustive. Indeed, based on the teachings herein, those skilled in the art may recognize other examples that fall within the spirit and scope of aspects of the subject matter described herein. Exemplary paragraph snapping conditions include:

1. A selection includes at least N lines of text and the paragraph includes 2N lines of text. For example, if a selection includes 3 lines of text and a paragraph includes 6 lines of text, this snapping condition may be satisfied.

2. A selection includes at least X lines of text and the paragraph includes Y lines of text, where Y is greater than X, and X and Y are hard-coded or configurable. For example, if X=3 and Y=5 and if 3 lines of text of a paragraph 5 lines long are selected, this snapping condition may be satisfied.

3. A selection is greater than a pre-defined percentage of the paragraph. For example, in one implementation, the snapping percentage may be 50%. In another implementation, the snapping percentage may be 75%. In another implementation, the snapping percentage may be X where X is any percentage between 0 and 100.

The pre-defined percentage of the paragraph may be hard-coded or configurable. For example, user input may be received that may be used to define the pre-defined percentage. For example, in one implementation, a user may indicate one of three types of snapping behavior, namely: aggressive, non-aggressive, and no snapping.

For example, if the user indicates aggressive snapping behavior, the pre-defined percentage may be determined as 50% (or another percentage). If the user indicates non-aggressive snapping behavior, the pre-defined percentage may be determined as 75% (or another percentage). If the user indicates no snapping, paragraph snapping may be disabled.

As another example, a user may be able to enter an actual percentage. For example, a user interface may allow a user to enter a percentage that is to be used when paragraph snapping is enabled.

The snapping percentage may be based on lines, sentences, characters, words, area, or the like without departing from the spirit or scope of aspects of the subject matter described herein.

4. A previous paragraph has already been selected and the user expands the selection over a next paragraph. For example, referring toFIG. 2, if the paragraph220has already been selected (e.g., through paragraph snapping or via other selection) and the user expands the selection by dragging a finger over the first line of the paragraph225, this may satisfy a condition for snapping the paragraph225.

5. A selection starts at the beginning of a paragraph and includes an amount of text of the paragraph that is over a threshold. For example, referring toFIG. 2, if a selection starts at the beginning of the paragraph225and includes the first 2 lines of the paragraph225, this snapping condition may be satisfied. The “amount of text” may include, for example, any of the measures previously indicated.

6. A combination of two or more of the above.

At block530, the selection is snapped to the paragraph. For example, referring toFIGS. 2 and 4, the processing unit120may update a data structure in RAM132to indicate that the selection230now covers the entire paragraph220(as illustrated by selection430inFIG. 4).

At block535, snapping of the paragraph is indicated on an output device. For example, referring toFIG. 4, a line may be drawn that surrounds the paragraph220and visually indicates that the selection430has been snapped to the paragraph.

The visual indication illustrated inFIG. 4is exemplary only. Other types of indications may include, for example, highlighted text, different colored text, inverted text, markers around the selected paragraph, other graphical indications, other non-graphical indications (e.g., voice or other sound, braille, or the like), and the like.

At block540, other actions, if any, may be performed.

In addition, additional actions may be performed at block525as part of determining whether paragraph snapping conditions are met. These additional actions may include, for example:

1. Detecting whether the expansion input is provided via a touch screen, and, if not, disabling paragraph snapping behavior.

2. Detecting that the selection as resized expands into white space (e.g., the blank space between paragraphs), and visually indicating that the selection includes the entire paragraph but does not include the white space.

3. Determining that selection input is expansion input if the selection input is in a direction of flow of the text.

Turning toFIG. 6, at block605, the actions begin. At block610, contraction input is received. Contraction input includes input that makes the selection size smaller. For example, referring toFIG. 4, a user may provide expansion input by placing a finger on the end of the selection430and dragging the finger left or up in the paragraph220. Furthermore, contraction input may be received for any size selection and is not restricted to selections of full paragraphs.

At block615, paragraph snapping is cancelled. For example, referring toFIG. 1, the processing unit120may update a data structure in the RAM132that indicates that paragraph snapping is disabled for a selection activity.

At block620, the selection is made smaller in accordance with the contraction input. For example, referring toFIGS. 3 and 4, if the selection430resulted from paragraph snapping as the selection330was expanded, then when paragraph snapping is cancelled for the paragraph220, the start of the selection may return to the beginning of the selection330ofFIG. 3.

In addition, after paragraph snapping is cancelled, paragraph snapping rules may be disabled. Once disabled, a user may select specific parts of a paragraph by providing expanding or contracting input for the selection.

At block625, other actions, if any, may be performed. For example, if additional user input indicates that the selection is to be expanded to a second paragraph, paragraph snapping behavior may be re-enabled.

The processing unit120ofFIG. 1may be programmed through computer-executable instructions to perform the actions indicated above. The monitor191, printer196, speakers197, or other output device may be used to provide a representation of a document on which paragraph snapping is performed.

As can be seen from the foregoing detailed description, aspects have been described related to paragraph snapping. While aspects of the subject matter described herein are susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and have been described above in detail. It should be understood, however, that there is no intention to limit aspects of the claimed subject matter to the specific forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of various aspects of the subject matter described herein.