diff --git a/src/org/omegat/core/segmentation/Segmenter.java b/src/org/omegat/core/segmentation/Segmenter.java index e587e3766c..8b1c774133 100644 --- a/src/org/omegat/core/segmentation/Segmenter.java +++ b/src/org/omegat/core/segmentation/Segmenter.java @@ -68,8 +68,7 @@ public SRX getSRX() { * @param paragraph * the paragraph text * @param spaces - * list to store information about spaces between sentences (can - * be null) + * list to store information about spaces between sentences (can be null) * @param brules * list to store rules that account to breaks (can be null) * @return list of sentences (String objects) @@ -118,13 +117,11 @@ public List segment(Language lang, String paragraph, List } /** - * Returns pre-sentences (sentences with spaces between), computed by - * breaking paragraph into chunks of text. Also returns the list with "the - * reasons" why the breaks were made, i.e. the list of break rules that - * contributed to each of the breaks made. + * Returns pre-sentences (sentences with spaces between), computed by breaking paragraph into chunks of + * text. Also returns the list with "the reasons" why the breaks were made, i.e. the list of break rules + * that contributed to each of the breaks made. *

- * If glued back together, these strings form the same paragraph text as - * this function was fed. + * If glued back together, these strings form the same paragraph text as this function was fed. * * @param paragraph * the paragraph text @@ -247,8 +244,7 @@ static class BreakPosition implements Comparable { } /** - * Other BreakPosition is "equal to" this one iff it has the same - * position. + * Other BreakPosition is "equal to" this one iff it has the same position. */ public boolean equals(Object obj) { if (obj == null) { @@ -270,12 +266,10 @@ public int hashCode() { /** * Compares this break position with another. * - * @return a negative integer if its position is less than the - * another's, zero if they are equal, or a positive integer as - * its position is greater than the another's. + * @return a negative integer if its position is less than the another's, zero if they are equal, or a + * positive integer as its position is greater than the another's. * @throws ClassCastException - * if the specified object's type prevents it from being - * compared to this Object. + * if the specified object's type prevents it from being compared to this Object. */ public int compareTo(BreakPosition that) { return this.position - that.position; @@ -329,15 +323,14 @@ public String glue(Language sourceLang, Language targetLang, List senten Matcher matcher = LINE_BREAK_OR_TAB_PATTERN.matcher(sp.toString()); if (matcher.find()) { // If we found line break or tab, trim left spaces. - // Right spaces are left for indentation of the next - // line. + // Right spaces are left for indentation of the next line. String leftSpaces = matcher.group(1); if (!leftSpaces.isEmpty()) { sp.replace(0, leftSpaces.length(), ""); } } else if ((lastChar != '.') && (!PatternConsts.SPACY_REGEX.matcher(rule.getBeforebreak()).matches() - || !PatternConsts.SPACY_REGEX.matcher(rule.getAfterbreak()).matches())) { + || !PatternConsts.SPACY_REGEX.matcher(rule.getAfterbreak()).matches())) { sp.setLength(0); } } @@ -354,13 +347,10 @@ public String glue(Language sourceLang, Language targetLang, List senten * Segment source and target entries from TMX when counts are equals. */ public void segmentEntries(boolean needResegment, Language sourceLang, String sourceEntry, - Language targetLang, String targetEntry, List sourceSegments, - List targetSegments) { + Language targetLang, String targetEntry, List sourceSegments, List targetSegments) { if (needResegment) { List srcSegments = segment(sourceLang, sourceEntry, null, null); - if (targetEntry != null) { // There is no translation for this - // entry, because for instance it's a - // note + if (targetEntry != null) { // There is no translation for this entry, because for instance it's a note // on an untranslated entry List tarSegments = segment(targetLang, targetEntry, null, null); @@ -371,8 +361,7 @@ public void segmentEntries(boolean needResegment, Language sourceLang, String so } } } - // No need to resegment, or segments counts not equals, or no - // translation + // No need to resegment, or segments counts not equals, or no translation sourceSegments.add(sourceEntry); targetSegments.add(targetEntry); diff --git a/src/org/omegat/core/segmentation/datamodels/MappingRulesModel.java b/src/org/omegat/core/segmentation/datamodels/MappingRulesModel.java index 856d2f3c39..0929df2b40 100644 --- a/src/org/omegat/core/segmentation/datamodels/MappingRulesModel.java +++ b/src/org/omegat/core/segmentation/datamodels/MappingRulesModel.java @@ -118,8 +118,8 @@ public Class getColumnClass(int columnIndex) { /** Adds a new empty mapping rule. */ public int addRow() { int rows = srx.getMappingRules().size(); - srx.getMappingRules() - .add(new MapRule(OStrings.getString("SEG_NEW_LN_CO"), "LN-CO", new ArrayList())); + srx.getMappingRules().add( + new MapRule(OStrings.getString("SEG_NEW_LN_CO"), "LN-CO", new ArrayList())); fireTableRowsInserted(rows, rows); return rows; }