I am in project where we are building a simple web calendar using Java EE technologies.
We define a table where every row is an employee, and every column represents an hour interval. The table width and column widths are adjustable. In every cell we have a text retrieved from a database, indicating what the employee is doing / should do in that time interval.
The problem is that sometimes the text in cells is getting bigger than the actual cell.
My task is to make the text more “readable” by reducing it’s length in a “smart way” so that it can fit in the cell more “gracefully”.
For example if initially in a cell I have: “Writing documents”, after the resize I should retrieve: “Wrtng. dcmnts” or “Writ. docum.” so that the text can fit well.
Is there a smart way to do it ? Or removing vocals / split the string in two is enough ?
If you are not able to store abbreviations you’re probably going to get stuck with some rules such as:
You get the picture, it’s fiddly but not rocket science.
You could combine this with a set of rewrite rules for common words and for common groups of letters. For example:
I suspect applying rules first, then an abbreviating algorithm will give more pleasing results.