Rapporter/pander — pull request #93 by RomanTsegelskyi (2014-06-20 19:25:42+00:00)
Title: Hyphening support for splitting cells implementation

I have added support for using hyphening when splitting large cells. It is implemented by using hyphenation algorithms from [koRpus package](http://cran.r-project.org/web/packages/koRpus/index.html).
Generally it follows all the same rules as relative split of large cells (like in #90), just when use.hyphening option is enabled, it will try to split.words using line breaks also.
_For example_
```
d> df <- data.frame(a="Machiavellianism", b="Hypervitaminosis")
d> pander(df, split.cells=10)

---------------------------------
a b
---------------- ----------------
Machiavellianism Hypervitaminosis
---------------------------------
d> pander(df, split.cells=10, use.hyphening = TRUE)

-------------------
a b
--------- ---------
Machi- Hypervit-
avellian- aminosis
ism
-------------------
```
_More general examples_
```
d> text1<- "A named character vector to define replacements for koRpus’ internal headline and paragraph tags."
d> text2 <- "Caseless matching does not make much sense for bytes in a multibyte locale, and you should expect it only to work for ASCII characters"
d> y <- c(text1, text2, "10000000000", "1234567890", text2, "Pandoc Package")
d> y <- matrix(y, ncol = 3, nrow = 2)
d> pander(y, use.hyphening = TRUE, split.table = Inf, split.cells = 10)

---------- ----------- ----------
A named 10000000000 Caseless
charac- matching
ter vec- does not
tor to de- make much
fine for sense for
koRpus’ bytes in
internal a multi-
headline byte lo-
and para- cale, and
graph you
tags. should ex-
pect on-
ly to
work for
ASCII
charac-
ters

Caseless 1234567890 Pandoc
matching Package
does not
make much
sense for
bytes in
a multi-
byte lo-
cale, and
you
should ex-
pect on-
ly to
work for
ASCII
charac-
ters
---------- ----------- ----------

d> pander(y, use.hyphening = TRUE, split.table = Inf, split.cells = 20)

-------------------- ----------- --------------------
A named character 10000000000 Caseless matching
vector to define re- does not make much
placements koRpus’ sense for bytes in
internal headline a multibyte lo-
and paragraph tags. cale, and you
should expect it on-
ly work for ASCII
characters

Caseless matching 1234567890 Pandoc Package
does not make much
sense for bytes in
a multibyte lo-
cale, and you
should expect it on-
ly work for ASCII
characters
-------------------- ----------- --------------------