Skip to content

Commit

Permalink
Improved Resegmenter
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Apr 1, 2023
1 parent dede967 commit a62f209
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file modified lib/openxliff.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/com/maxprograms/converters/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private Constants() {

public static final String TOOLID = "OpenXLIFF";
public static final String TOOLNAME = "OpenXLIFF Filters";
public static final String VERSION = "3.5.0";
public static final String BUILD = "2023031_0958";
public static final String VERSION = "3.6.0";
public static final String BUILD = "20230401_0723";

public static final String SUCCESS = "0";
public static final String ERROR = "1";
Expand Down
3 changes: 1 addition & 2 deletions src/com/maxprograms/converters/html/Html2Xliff.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class Html2Xliff {
private static boolean keepFormat;

private static Segmenter segmenter;
private static String catalog;
private static String first;
private static String last;
private static String targetLanguage;
Expand All @@ -89,7 +88,7 @@ public static List<String> run(Map<String, String> params) {
sourceLanguage = params.get("srcLang");
targetLanguage = params.get("tgtLang");
srcEncoding = params.get("srcEncoding");
catalog = params.get("catalog");
String catalog = params.get("catalog");
String paragraphSegmentation = params.get("paragraph");
if (paragraphSegmentation == null) {
segByElement = false;
Expand Down
3 changes: 2 additions & 1 deletion src/com/maxprograms/xliff2/Resegmenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private static void recurse(Element root) throws SAXException, IOException, Pars
translate = "yes".equals(root.getAttributeValue("translate", translate ? "yes" : "no"));
}
if ("unit".equals(root.getName())) {
if (translate && canResegment && root.getChildren("segment").size() == 1) {
boolean hasMatches = !root.getChildren("mtc:matches").isEmpty();
if (translate && canResegment && !hasMatches && root.getChildren("segment").size() == 1) {
Element segment = root.getChild("segment");
String originalId = segment.getAttributeValue("id");
String unitId = root.getAttributeValue("id");
Expand Down

0 comments on commit a62f209

Please sign in to comment.