Why put paragraph back together? For printing a text, your favorite word processor can handle things very well: printing on two columns, justifying the text, reduce font size... Yet, do to this, the text need to be organized as paragraph. This is what TTR do.
The main usages of TTR are:
I already can here you saying: "Are you crazy, how can you print Neon Exodus Evangelion ?" Well, this little story which is about 2Mo long can be printed using only 236 pages... This could not be done if paragraphs were not put back together.
- Exporting a text to clean HTML
- Exporting a text in "paragraph" format (each line is a paragraph), so it can be use in a word processor for printing with justifying paragraph and putting the text on many columns.
- Wrapping a text against a specific right margin (for publishing in text format, or read a story published in text format that as not been wrapped)
- Emphasizing the text structure for easier reading (indent paragraph and/or skip a line before each paragraph)
In the following sections, I will use excerpt from many fanfictions to illustrate the examples.
Now, you may use TTR in many different way. What is presented is the way I use it, which I found is quite time saving.
Makes a copy of the text(s) to reformat in a given directory (TTR will overwrite the original text on saving). Then drag and drop the copied files from the directory which contains the version to reformat into the main window of TTR.
In the following section, I will drive you through the reformatting and the most typical text format you encounter in fanfiction texts. All those example texts are available in the examples directory, in the same directory where you installed TTR. Before you start, makes a copy of those examples into another directories so you can save the result of the reformatting process.
Well, there are basically two kinds of "well" formatted text. The first
one is illustrated by the following example:
With a scream and a leap Sailor Sun launched herself to where
Now, look at the text above and tell me what are the clues that indicate
you where a paragraph begins. Ah, that one is easy: each paragraph is
preceded by a blank line. That it, you got it! The reformatting engine
just does that. You adjusting the engine setting so that you activate the
"when a line is preceded by a blank line, that line begins a paragraph".
Now, let's study the second case:
Nene, stretched and yawned, and turned back to her computer. It was
Well, this time the rule would be something like:
"the line is indented (it has space at the beginning) therefore it begins a paragraph".
Let's reformat those two texts...
First, open your copy of the example file s_ranko.txt which can be found in the examples directory where you installed TTR. You can do this using the "File/Open..." menu, or by dragging the file from your file manager (Explorer, Windows Commander...) and dropping it into TTR' s main window.
Open the settings dialog (select the menu in the "general settings" menu or press the button in the toolbar).
You should see something like that:
The options in the top frame box apply to rule that determine if a line begin a new paragraph. The options in the middle frame box apply to rule that prevent a line from beginning a new paragraph (those rules override those of the top frame box). The options in the bottom frame box determine what character may compose a separator line. Separator are usually use to mark time or space discontinuity between two scene ("* * *" for example).
As we can see, the rules that are active by default are those we need to reformat the to previous example. Close the dialog and press the Tab key, that will reformat the selected block using the analysis engine settings. Since no block is selected, the action is applied to all the text.
You should now see the following:
As you read in the section "Understanding the view ", a long red right arrow indicates the beginning of a paragraph, and a short violet left arrow indicates that the line belongs to the same paragraph as the previous line. Now, scroll down to the end of the text using the page down key to check that the analysis tool did not make any mistake.
Everything should be ok, so now we'll save the text as a text file and an HTML file. That is simple, press Ctrl+S to save it as a text file (that will overwrite the original text), and press Ctrl+H to save a copy of the text in HTML. The HTML file will be at the save location as the original text but with the .html extension.
Open the HTML file in you web browser. You can see that you get a clean HTML file that can resize the paragraph as you change the window size. And it that was done in a matter of seconds !!! Click here to see an example of the HTML output you get.
Open the text in your preferred word processor, you can now change the presentation. I personally like to justify the text, use a 8 points font, 2 columns of text, a separator line between the column. I found that those setting easier to the eyes (they move less, so you tired as much as you would otherwise). If you don't have any word processor, just launch WordPad, open the text, and in the Display/Options menu, change the line break setting so it can resize with the window...
You can reformat the text of the second example by following exactly the same steps. The example file is maximum-polarity.txt.
Running up the stairs to the temple's courtyard, they could hear
Well this one is harder. There is neither indent nor blank line to indicates
paragraph. The best clue we have is that the previous line ended a sentence,
and therefore possibly a paragraph. Another one is that the sentence
ended nowhere near the end of the line. So we have a rule like:
"The previous line ended a sentence".
The second clue (the line was short) is not used yet (see planned features ). The current formatting is hard to read. But using TTR you can refomat the text so that paragraph will be indented making it much easier to read.
Because this rule is not 100% sure you should skim through the text to check the result. For example, the sentence in red would have been detected as ending a paragraph which it does not (though those errors usually don't matter much). See the detail section on how to use some rules of the engine to improve the result.
Open the file OhMyDevi.txt. Open the analysis setting dialog and go in the second Tab. This Tab is used to deal with text of that kind. It is the "End of Sentence Mode". Check the "End Of sentence mode activated" option to activate the EOS mode. The edit field allows you to specify which characters may end a sentence. You should have something like this:
Now, close the dialog by clicking the Ok button, and press Tab to reformat the text. But remember in the example, there was a line that should not have been indented. Search that line (press Ctrl+F and type sultry). Glue the next line by selecting it and pressing the left arrow . You can now save the text. Load it in your browser, and you get a nicely presented resizeable text. Click here to the reformatted HTML text. Well, you now the basic now. Let's see one last example where I quickly introduce a few more analysis settings.
Sato: [rubbing head] Gomen, Yamakawa-san, but we don't have time for the long
Well, that format is nasty but it's not that bad. The first rule we
can find is:
"a line that contains ':' (after a character name) begins a paragraph".
The second one would be:
"a line that begin with '[' begins a paragraph".
Set the settings to activate those rules. The settings dialog should
be as follow:
Press the Tab key to reformat and the magic is done. Child game
isn't it ?
What does those arrows indicates ?
The button is used to change the analysis settings (open the settings dialog).
is used to preview the reformatted output as HTML. A temporary HTML file
is created and automatically open in your web browser.
The second button group ( ) is used to manipulate line one at a time.
In the third button group, is used to reformat the current block, or all the text if no block is selected. is used to guess what is the right margin to use with the right margin rule .
This second screen shot illustrate the e-mail and news mode:
The dark orange highlight in the left margin (
) indicates the quotation mark used to identify the quotation depth.
|up arrow||Move up by 1 line|
|down arrow||Move down by 1 line|
|page up||Move up by 1 page|
|page down||Move down by 1 page|
|home||Move to the beginning of the document|
|end||Move to the last line of the document|
|F3||Search the next occurrences of the searched text.|
|Shift+Tab||Indent the block|
|Ctrl+Tab||Glue the block|
|Tab||Run the analysis on the block|
|Spacebar||Reset block to its original indentation|
Opening a new text
||Open from text file
||Paste text from clipboard
Previewing the reformatted text
||Preview the reformatted text as HTML
Saving the reformatted text
||Save as text
||Save as text and ask the filename
||Save as wrapped text
||Save as wrapped text and ask the filename
||Save as HTML
||Save as HTML and ask the filename
||Save as text to clipboard
||Save as wrapped text to clipboard
||Save as HTML to clipboard
||Run the reformatting engine on the selected
block (or all text if no block is selected)
||Makes each line of the selected block a distinct
||Makes all lines of the selected block part of
the paragraph starting immediately before the first line of the block
||Makes each lines of the selected block a distinct
paragraph, but keep the original indentation when saving
||Set the right margin used by the right margin
rule to the length of longest line of the selected block
||Makes the current line part of the same paragraph
as the previous line
||Makes the current line a distinct paragraph.
Press twice to toggle from glued to indented
Moving into the view
||Moves the current line up. Scroll the view to
keep the current line centered
||Moves the current line down. Scroll the view
to keep the current line centered
||Moves the current line up by one page. Scroll
the view to keep the current line centered
||Moves the current down by one page. Scroll the
view to keep the current line centered
||Scroll the view to the left
||Scroll the view to the right
||Makes a new selection, or extends the current
selected block one line up
||Makes a new selection, or extends the current
selected block one line down
|Line is a blank line
||when a line is a blank line, that line begins
|Line is indented
||when a line is indented (it has space(s) at
the beginning) then that line begins a paragraph.
|Previous line is a blank
||when a line is preceded by a blank line, that
line begins a paragraph
|Line contains ':'
||when a line contains the character ':' (a colon),
that line begins a paragraph.
|Line begin with...
||when a line begin with a character specified
in the edit field beside the option (bracket and square bracket are the default),
that line begins a paragraph .
||specify the number of 'space' that make up the
left margin of the text. If activated, only line with more that the specified
number of space will be considered indented.
|E-mail and new rules
||when activated, e-mail and news quotation marks
(the "> " string at the beginning of quoted e-mail lines) will be virtually
stripped before the text is analyzed. If the quotation mark of the current
line is different from the quotation mark of the previous line, then the
line begins a paragraph, otherwise the other rules are applied as if the
quotation marks did not exist.
Rules preventing an indentation
||prevents a paragraph from beginning inside an
enclosed part of text (a paragraph can not begin inside a pair of square
brackets for example).
|Line does not begin with an upper case letter
||prevents a line from beginning a paragraph if
it does not start with an upper case letter.
||if a line contains only the characters specified
in the edit field beside the option, then that line is centered.
|End of sentence mode activated
||use that options when a text structure is not
apparent (there is no blank or between paragraph, and paragraph are not indented).
When enabled, a new paragraph will be started if the previous line ends
a sentence (ends with one of the character specified in the "End of sentence
characters' edit field).
||the case of use of this options is similar to
the end of sentence mode. Yet, you should be more careful when using it.
When enabled, a new paragraph will be started if the first word of the current
line, when added to the previous line, produce a line longer than the "right
margin" length specified in the edit field beside the option. This options
can produce good result on text that is well formatted. You usually use the
"determine right margin" action to find out what is the actual maximum line
length in the file (toolbar button
, or Ctrl+R). When the right margin mode is active, the text is
displayed using a fixed width font and the right margin position is shown
with a vertical red line).
|End of sentence characters
||specify the list of characters that may end a
|Jump one line after each paragraph||insert one blank line between each paragraph
|Remove ending hyphen
||if a line ends with '-' then it is collated with
the next line and the hyphen is removed
||used to define how the indentation of indented
paragraph (those starting with a red arrow pointing to the right) is outputted
||tabulation(s) is/are outputted to indent the
paragraph (I recommend this if printing, when loading the file in your word
processor, you can set up the actual tabulation length)
||space(s) is/are outputted to indent the paragraph
(I recommend this when publishing on the web in text format)
||output the the original 'indent' string.
|Number of spaces or tabulations per indentation
||specify the number of spaces or tabulation that
is outputted for an indented paragraph.
|Wrapping at column #
||specify the maximum number of character
per line when wrapping the outputted text