Talk:Word wrap: Difference between revisions
m →handling long words: changed very tense. -- ~~~~ |
m →handling long words: added an article. -- ~~~~ |
||
Line 27: | Line 27: | ||
==handling long words== |
==handling long words== |
||
This subject came up in a REXX newsgroup some time ago (regarding formatting of text). |
This subject came up in a REXX newsgroup some time ago (regarding the formatting of text). |
||
What does a word-wrapper program do when encountering a word longer than the working margins? |
What does a word-wrapper program do when encountering a word longer than the working margins? |
Revision as of 21:08, 20 August 2013
Run BASIC
Hmm. I definitely think the task requirements should be changed, just not sure how yet. Not sure I want to disallow external programs, but a solution doesn't meet my intent if the wrapped text is never returned to the main program. —Sonia 20:56, 28 March 2012 (UTC)
After sleeping on it, maybe it's okay. I did say simple, and the solution does after all, show the wrapped text pasted back into RC as output. —Sonia 00:33, 30 March 2012 (UTC)
more options
I think it would be nice to add some options:
- --justification-- (aligning the left AND right margins.
- --left ragged edge-- as if the text is meant to be read from right to left (also called right justification).
- --sentences-- add extra blanks for end-of-sentences.
- --centering-- centered justification.
- --margins-- support the use of margins.
- --indentation-- also, support negative indentations.
- --paragraphs-- whenever a blank line, or (say), when the ¶ (paragraph) symbol is detected.
- --columnar output-- support multiple (newspaper) columns (with/without a separator border). -- Gerard Schildberger 03:52, 31 March 2012 (UTC)
- Thanks for the ideas! Some of these I had thought of, but I wanted to leave the basic task as simple as possible, letting people either code a very simple algorithm or show an equivalent even simpler method. Your ideas might make interesting extra credit or even separate tasks. Of course, It's a wiki...you can make any changes you feel strongly about; I just liked the least squares metric described in the WP article and though an alternative algorithm would make interesting extra credit and that adding that would be plenty for a single task. —Sonia 17:29, 1 April 2012 (UTC)
There are two tasks relating to word wrapping
Some languages provide an inbuilt facility for word wrap within the width of the screen (whereas wrap to a particular column width involves a bulkier overhead). We also need a wordwrap task to demonstrate the simpler scenario of wrapping to screen width. This would give us two tasks: Wordwrap/Screen Width and Wordwrap/Custom Width.
Markhobley 19:25, 5 February 2013 (UTC)
handling long words
This subject came up in a REXX newsgroup some time ago (regarding the formatting of text).
What does a word-wrapper program do when encountering a word longer than the working margins?
Several choices:
- truncate the word
- truncate the word (with footnote or some such indicator)
- show as-is
- hyphenate the word
- other
My REXX program (version 1) doesn't truncate long words, but instead, show the word in its entirety (with possible wrapping), thereby preserving the text content. Other programs are not so kind (some even loop forever), but I suppose this situation is beyond the intent of the task.
By the way, REXX has the feature that if you display a line longer than the terminal (or window), it will break up the line and show the full text. -- Gerard Schildberger (talk) 21:05, 20 August 2013 (UTC)