The Text Reformatter
Lastest changes
- 2011/03/19: Ttr 1.6.5, source ported to
Microsoft Visual Studio 2008 now available for download.
- 2002/02/20: Ttr 1.6.5
, added HTML preview. It is now possible to reformat and read story on
the fly (very useful when reading badly wrapped story). The documentation
can also be open from the HELP menu.
Behind the scene, some works as been done on the code. The move to CppUnit
is more thorough (use some cool assertion helpers I wrote a while
ago), and unit testing is now integrated to the build cycle.
- 2002/02/18: Ttr 1.5.4
, added support to wrap text when saving. The documentation has been heavily
revised and completed (I strongly advise to skim over it). Wrapped text
output can be copied to the clipboard and pasted back into Ttr, so you can
read it with Ttr (trick to be replaced by an internal viewer someday). The
core reformatting engine as been completly rewrote and is backed up with
unit test.
Added another example
in the overview section, to show that Ttr do a bit more than just unwrapping
text, and can make your life a lot easier. - 2000/09/20:
Ttr 1.4.3
, Added support to reformat mails and news. Here is a
sample
of the result of the reformatting saved as HTML.
This
was the original text. A big thank to Benjamin Goldberg for is
excellent suggestions! The sample text was reformatted using the "Right
margin" rule combined with the "Line does not contains an upper case..."
rule. Those two seems pretty well suited for mail reformatting. See the
What's new
section for details.
- 2000/09/18: Ttr 1.3.3
, Completely rewrote the writing process. The HTML rendering is much
better and now matches the setting. A new tag system has been introduced
so any line can be centered. See the What's new
section for details.
Though there is not so many new functionnalities,
Ttr now has a much more flexible architecture: the writing process has
been splitted in two processes, one that reformats the text (the reformatting
process), and the other that takes the reformatted and saves it as specified
by the user (the writing process). The result: the writing process now know
absolutely nothing about the reformatting process, making things much easier
to add new format (I'm thinking about wrapped text as a near target) and
changes the reformatting process. - 2000/09/06:
Ttr 1.2.2
, Can now create a new document by pasting to clipboard and save a document
to the clipboard in either text or HTML format. A new rule has been added
to help working with many text. See the What's new
section for details.
- 2000/08/19: Ttr 1.1.1
, Refactored the reformatting and writing process. This allowed me to
greatly improve of the reformatting and writing process. See the
What's new
section. I still need to update the documentation. Ttr 1.0 documentation
should do for now, just think that stuff are a bit more generic...
- 2000/05/27: Ttr 1.0, is finally available.
Content
Overview
Requirement
Licensing
Download
What's new
About version numbering
Questions, comments and bugs reports
User Guide
(separate page)
Overview
Ttr is a tool that deals with text, more specifically
fanfiction kind text. Ttr analyses the text and tries to guess the structure
of the text. Basically it put the paragraph of a text back together. The
reformatted text can then be exported as text, or as HTML.
Why put paragraph back together? Well, there are a
lot of tools that can deal properly with paragraph, such as word processor.
The two mains use I found for Ttr are:
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.
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... Checks there if you want
to see it! This could not be done if paragraphs were not put back together.
Here is a sample of this text
file
reformatted by Ttr and saved as HTML
. This is done in a few seconds!!! Well this was a well formatted text
file. Here is another sample.
This text
has been tortured through cut & paste, and e-mail transfert. Here
is the text, reformatted with
Ttr
and saved as HTML. Which one do you think is the more likely do be read
? The first one which strains the eyes and is tiring to read, or the reformatted
text which structure is easily grasped? It is another one of the reasons
which I created Ttr for: to makes text reading more easier to the eyes.
Here is a screen shot:
[Excerpt from "Tale of Younger Venus" by Douglas Helm.]
Requirement
- Operating system : Windows 95/NT/2000.
- Compiler: Visual C++ 6.0 (only required for source code compilation,
not required to use Ttr) VC++ 5.0 for release previous to 1.5.4.
Licensing
Ttr is covered by the Gnu Public License
.
Download
To use Ttr, you only need to download the binary.
The binary is about 520Ko and the source code is about 590Ko previous to
1.5.4 and 880Ko starting from 1.5.4.
Ttr 1.6.5 binary
(include setup executable & documentation).
Ttr 1.6.5 source code for Microsoft Visual Studio 6
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the CppUnit 1.7.0, Ttr source and documentation).
Ttr 1.6.5 source code for Microsoft Visual Studio 2008
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the CppUnit 1.7.0, Ttr source and documentation).
Ttr 1.5.4 binary
(include setup executable & documentation).
Ttr 1.5.4 source code
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the CppUnit 1.7.0, Ttr source and documentation).
Ttr 1.4.3 binary
(include setup executable & documentation).
Ttr 1.4.3 source code
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the Test Framework Library). Does not include documentation.
Ttr 1.3.3 binary
(include setup executable & documentation).
Ttr 1.3.3 source code
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the Test Framework Library). Does not include documentation.
Ttr 1.2.2 binary
(include setup executable & documentation).
Ttr 1.2.2 source code
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the Test Framework Library). Does not include documentation.
Ttr 1.1.1 binary
(include setup executable & documentation).
Ttr 1.1.1 source code
. (Zip file, see Ttr/compile.txt for compilation instruction. Includes
the Test Framework Library). Does not include documentation.
About version numbering
The version number format is xx.yy.zz, where
a change of :
xx indicates a major architecture change,
yy indicates that some functionnalities have
been added, and
zz indicates that some bugs have been fixed.
What's new
-
Ttr 1.6.5:
- Documenation
- Added help for the new HTML preview features
- Updated How to...
- Gui
- Documentation can be opened from the Help menu
- Removed the "tag" system that was useless. It has been replaced
by a single flag associated to each line that indicate if the paragraph
is to be centered or not.
- Writting
- Added HTML preview. The reformatted text can be previewed as
HTML automatically
- BugFix: fixed a bug that occured on a very specific conditiion
-
Ttr 1.5.4:
- Documentation:
- The documentation has been completly revised to reflect available
features.
- Dialog settings options are detailed
- Keyboard shortcut are listed
- It is strongly advise to at least skim over the new documentation
- Formatting:
- The trailing space character of an indent string from the
"e-mail indent string" rule is now removed from the indent string. The left
margin rule should be used to ignore this character to do the proper formatting.
- BugFix: added "" in the default enclosure list. Look like they
have been inadvertently removed...
- BugFix: many little bugs have been fixed. The formatting engine
has been completly rewritten, and unit tests ensure that the engine is
working correctly.
- Gui
- The indent string is shown with a different background color.
- BugFix/Feature: The number of occurences of right red arrow showing
that a line is indented now match the actual indent level of the line.
Since Version 1.3.3 the actual indent level of a line was used when writing
(to put more than one tabulation), but nothing is the GUI showed that!
- Writing:
- Added wrapped text as an output format. Wrapped text output supports
everything (indent string, indent, block quote (multiple indent level),
centering). This output mode can be used to publish your work in text format,
but also to read the reformatted text with Ttr. Here is how to do it: format
your text, and copy the wrapped reformatted text to the clipboard (Ctrl+X).
You can paste the wrapped text into Ttr using (Ctrl+V).
-
Ttr 1.4.3:
- Formatting:
- Added the "mails & new rule". That rules does a lot of things.
- It detects the indent string at the beginning of the line (you
know, those "> > >"), stores it, and allows the others rules to
work as if that indent string was not present on the line (so you can still
use user rules such as is indent, previous line is blank...). As of now,
the indent can be composed of '>' or ':' with one optional space between
each occurrence of one of those characters ( "[>: ]*[>:]" if I remember
my regular expression correctly). That also means that the trailing space
is not included (you can used the "left margin" setting to remove that one!
- It detects change in the indent string length and indents the
line if the indent string length has changed. That is if the indent string
of the previous line was "> > >" and it is now "> >" then
the current line will be indent. There is one exception thought. If the
current line does not have an indent string (no ">" at the beginning
of the line), then the change is ignored (You'll often find words from the
previous line when the text has been wrapped with a shorter right margin).
- Reformatting:
- The HTML output has been modified to show the indentation level
of a line. Checks this
out, it's really nice. Thanks Benjamin!!! While the indentation level
is shown, all the others stuffs are still available (the text is within a
table's cell), that is you can center or indent the line... There is no text
support for this features at the current time. If you have any ideas how
to do that, let's me know
!
-
Ttr 1.3.3:
- Gui:
- A column has been added in the left margin to indicates when a
line carry some tags... A "T" icon appears on the right side of the left
margin.
- Two new buttons on the toolbar. The "C" button is used to toggle
the "center" tag on the current block/line, and the "T" button is used to
see the tag that the current line carry (there not really any use for that
one at the moment since there can be only one tag!)
- Reformatting:
- The first line of a paragraph indicates how the paragraph will
be aligned. Therefore to center a paragraph, only the first line of that
paragraph need to have the "center" tag...
- Formatting:
- The centering rule "separator line" now both indent the line and
adds the tag "center" to the line if it matches the rule.
- All the tags set by the formatting engine (understand all tags
that you have not set yourself) are removed before formatting. This means
that all the tags you have set yourself will remains (isn't that nifty!).
- Writing:
- The "jump one line before each indented line" setting has been
changed to "jump one line after each paragraph".
- The HTML writer does a much better job: it can now handles all
the setting (uses tag/space, and a specified level of indentation). The resulting
HTML now reflects what you would expect (jumps more than one line where
needed...)
-
Ttr 1.2.2:
- Gui:
- Can now create a document by pasting text from the clipboard (
Ctrl+N or Ctrl+V).
- Can now save a reformatted document to the clipboard in either
text or HTML format (Ctrl+C and Ctrl+W).
- Block analysis (Tab) reformats the whole text if no text
is selected.
- The rule has been reorganized within the "Block analysis tab".
The organization should make more sense than before. Also, you can notice
the new frame "Centering rule". That one is just one step ahead of some future
change: the possibility to center just any line you want (that just does
not make sense that the "separator" would be the only one to be centered).
Well, it's a planned stuff but I don't now when that one will come out (there
is just so much things to be done...)
- The rule "Line does not begin with an upper case" has been added
(found in the "block analysis tab", in the frame "rules preventing indentation").
That rule does what you may have guessed: it prevent the indentation of
lines that start with a lower case letter, therefore gluing them to the previous
line. This rule is really useful, since most of the text follow the commonly
accepted rules that a sentence should start with a upper case letter (unfortunately
its not always the case). This rule is better used with the "End of Sentence"
rule or the "Line is indented" rule.
- Writing:
- Bug Fix: Glued blank line where not glued when saving text. This
has been corrected.
- Bug Fix: When using the "Right margin" rule, if blank lines where
encountered they would begun a new paragraph every time. Now blank lines
began a new paragraph only if the "Line is a blank line" rule is enabled.
-
Ttr 1.1.1:
- Formatting:
- You can now define an unlimited number of enclosing strings, such
as (), [] << >> to prevent the creation of a paragraph...
- You can now define a left margin when using the "line is indented"
rule. This will disable the rule if the indentation is less than the specified
left margin. Great for text who sometime have one space at the beginning
of a line within a paragraph (you often got those when converting an html
text which was within a table)..
- You can now define a right margin. This rule more or less replace
the "End of sentence" rule and give better results. The rule is as this:
"if I append the first word of this line to the previous line and the resulting
line fit with the specified right margin, then the line is glued to the
previous line". A new button in the toolbar auto detects the position of
the right margin in the selected block and activates the right margin rule.
- You can now define a set of characters for the rule "if one of
those characters is at the beginning of the line, then this line begins a
paragraph". This replace the old rules "indent the line if it begins with
[, (...".
- Bug Fix: many bugs have been removed from the reformatting process
(the refactoring made them obvious, thanks to Martin Flower for this great
concept!!!).
- Writing:
- Bug Fix: fixed the bug that occurred when saving the text while
keeping the original indentation.
- A new option has been added to remove the hyphen at the end of
the line and collate the last word with the next line.
- Gui
- Bug Fix: the progress bar now appears while reformatting (yes it
was a bug)
- Miscellaneous:
- Major performance problem when working on big text (300Ko+) has
been solved.
- Refactored the reformatting process.
- Rewrote the writing process.
- Now I'm using Unit Test for the reformatting and writing process
(it was needed for the refactoring anyway)...
Questions, comments and bugs reports
Questions, comments and bugs reports are more than
welcome. You can reach me at the following address:
gaiacrtn@free.fr
Copyright ©2000-2002,
Baptiste Lepilleur
. http://gaiacrtn.free.fr/index.html