Skip to content

Commit

Permalink
Handle negative coords
Browse files Browse the repository at this point in the history
Handle negative coords (e.g. when loading from ALTO)
  • Loading branch information
chris1010010 committed Nov 12, 2019
1 parent 5d90b13 commit 56f960e
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 47 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/PrimaBasic"/>
<classpathentry combineaccessrules="false" kind="src" path="/PrimaText"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry combineaccessrules="false" kind="src" path="/PrimaMaths"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 2 additions & 2 deletions apidoc/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>All Classes (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>All Classes (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Constant Field Values (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Deprecated List (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>API Help (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
20 changes: 15 additions & 5 deletions apidoc/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Index (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down Expand Up @@ -68,7 +68,17 @@
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="contentContainer"><a href="#I:M">M</a>&nbsp;<a href="#I:O">O</a>&nbsp;<a href="#I:P">P</a>&nbsp;<a href="#I:R">R</a>&nbsp;<a href="#I:S">S</a>&nbsp;<a name="I:M">
<div class="contentContainer"><a href="#I:H">H</a>&nbsp;<a href="#I:M">M</a>&nbsp;<a href="#I:O">O</a>&nbsp;<a href="#I:P">P</a>&nbsp;<a href="#I:R">R</a>&nbsp;<a href="#I:S">S</a>&nbsp;<a name="I:H">
<!-- -->
</a>
<h2 class="title">H</h2>
<dl>
<dt><span class="memberNameLink"><a href="org/primaresearch/dla/page/converter/PageConverter.html#handleNegativeCoordinates-org.primaresearch.dla.page.Page-java.lang.String-">handleNegativeCoordinates(Page, String)</a></span> - Static method in class org.primaresearch.dla.page.converter.<a href="org/primaresearch/dla/page/converter/PageConverter.html" title="class in org.primaresearch.dla.page.converter">PageConverter</a></dt>
<dd>
<div class="block">Handle negative coordinates of any object with polygon.</div>
</dd>
</dl>
<a name="I:M">
<!-- -->
</a>
<h2 class="title">M</h2>
Expand Down Expand Up @@ -103,7 +113,7 @@ <h2 class="title">P</h2>
</a>
<h2 class="title">R</h2>
<dl>
<dt><span class="memberNameLink"><a href="org/primaresearch/dla/page/converter/PageConverter.html#run-java.lang.String-java.lang.String-boolean-boolean-">run(String, String, boolean, boolean)</a></span> - Method in class org.primaresearch.dla.page.converter.<a href="org/primaresearch/dla/page/converter/PageConverter.html" title="class in org.primaresearch.dla.page.converter">PageConverter</a></dt>
<dt><span class="memberNameLink"><a href="org/primaresearch/dla/page/converter/PageConverter.html#run-java.lang.String-java.lang.String-boolean-boolean-java.lang.String-">run(String, String, boolean, boolean, String)</a></span> - Method in class org.primaresearch.dla.page.converter.<a href="org/primaresearch/dla/page/converter/PageConverter.html" title="class in org.primaresearch.dla.page.converter">PageConverter</a></dt>
<dd>
<div class="block">Runs the conversion</div>
</dd>
Expand Down Expand Up @@ -131,7 +141,7 @@ <h2 class="title">S</h2>
<div class="block">Sets the filter rules that are to be applied to all text regions.</div>
</dd>
</dl>
<a href="#I:M">M</a>&nbsp;<a href="#I:O">O</a>&nbsp;<a href="#I:P">P</a>&nbsp;<a href="#I:R">R</a>&nbsp;<a href="#I:S">S</a>&nbsp;</div>
<a href="#I:H">H</a>&nbsp;<a href="#I:M">M</a>&nbsp;<a href="#I:O">O</a>&nbsp;<a href="#I:P">P</a>&nbsp;<a href="#I:R">R</a>&nbsp;<a href="#I:S">S</a>&nbsp;</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
Expand Down
2 changes: 1 addition & 1 deletion apidoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>JPageConverter API</title>
<script type="text/javascript">
tmpTargetPage = "" + window.location.search;
Expand Down
50 changes: 35 additions & 15 deletions apidoc/org/primaresearch/dla/page/converter/PageConverter.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>PageConverter (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand All @@ -18,7 +18,7 @@
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":9,"i3":10,"i4":10,"i5":10};
var methods = {"i0":9,"i1":9,"i2":10,"i3":9,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
Expand Down Expand Up @@ -152,41 +152,49 @@ <h3>Method Summary</h3>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#handleNegativeCoordinates-org.primaresearch.dla.page.Page-java.lang.String-">handleNegativeCoordinates</a></span>(org.primaresearch.dla.page.Page&nbsp;page,
java.lang.String&nbsp;negCoordsMode)</code>
<div class="block">Handle negative coordinates of any object with polygon.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#main-java.lang.String:A-">main</a></span>(java.lang.String[]&nbsp;args)</code>
<div class="block">Main function</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#run-java.lang.String-java.lang.String-boolean-boolean-">run</a></span>(java.lang.String&nbsp;sourceFilename,
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#run-java.lang.String-java.lang.String-boolean-boolean-java.lang.String-">run</a></span>(java.lang.String&nbsp;sourceFilename,
java.lang.String&nbsp;targetFilename,
boolean&nbsp;json,
boolean&nbsp;altoOutput)</code>
boolean&nbsp;altoOutput,
java.lang.String&nbsp;negCoordsMode)</code>
<div class="block">Runs the conversion</div>
</td>
</tr>
<tr id="i2" class="altColor">
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#runTextFilter-org.primaresearch.shared.variable.VariableMap-org.primaresearch.dla.page.Page-">runTextFilter</a></span>(org.primaresearch.shared.variable.VariableMap&nbsp;textFilterRules,
org.primaresearch.dla.page.Page&nbsp;page)</code>
<div class="block">Applies a set of filter rules to all text elements of the given page.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#setGtsId-java.lang.String-java.lang.String-">setGtsId</a></span>(java.lang.String&nbsp;pattern,
java.lang.String&nbsp;filepath)</code>
<div class="block">Sets the GtsId that is to be added to the PAGE document.<br>
Note: The ID has to be conform to the XML ID convention (start with letter, ...).</div>
</td>
</tr>
<tr id="i4" class="altColor">
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#setTargetSchema-java.lang.String-">setTargetSchema</a></span>(java.lang.String&nbsp;versionString)</code>
<div class="block">Sets the target PAGE XML schema version of the output file.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/primaresearch/dla/page/converter/PageConverter.html#setTextFilterRules-org.primaresearch.shared.variable.VariableMap-">setTextFilterRules</a></span>(org.primaresearch.shared.variable.VariableMap&nbsp;textFilterRules)</code>
<div class="block">Sets the filter rules that are to be applied to all text regions.</div>
Expand Down Expand Up @@ -245,7 +253,7 @@ <h4>main</h4>
</dl>
</li>
</ul>
<a name="run-java.lang.String-java.lang.String-boolean-boolean-">
<a name="run-java.lang.String-java.lang.String-boolean-boolean-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
Expand All @@ -254,14 +262,15 @@ <h4>run</h4>
<pre>public&nbsp;void&nbsp;run(java.lang.String&nbsp;sourceFilename,
java.lang.String&nbsp;targetFilename,
boolean&nbsp;json,
boolean&nbsp;altoOutput)</pre>
boolean&nbsp;altoOutput,
java.lang.String&nbsp;negCoordsMode)</pre>
<div class="block">Runs the conversion</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sourceFilename</code> - File path of input PAGE XML</dd>
<dd><code>targetFilename</code> - File path to output PAGE XML</dd>
<dd><code>json</code> - JSON input?</dd>
<dd><code>altoOutput</code> - ALTO XML output instad of PAGE?</dd>
<dd><code>altoOutput</code> - ALTO XML output instead of PAGE?</dd>
</dl>
</li>
</ul>
Expand Down Expand Up @@ -297,7 +306,7 @@ <h4>setGtsId</h4>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pattern</code> - A specific ID or [start,end], where 'start' is the index of the first character
and 'end' the index of the last character within the given filename (index starts with 0).</dd>
<dd><code>filename</code> - Required if the ID is to be extracted.</dd>
<dd><code>filepath</code> - Required if the ID is to be extracted.</dd>
</dl>
</li>
</ul>
Expand All @@ -318,7 +327,7 @@ <h4>setTargetSchema</h4>
<a name="setTextFilterRules-org.primaresearch.shared.variable.VariableMap-">
<!-- -->
</a>
<ul class="blockListLast">
<ul class="blockList">
<li class="blockList">
<h4>setTextFilterRules</h4>
<pre>public&nbsp;void&nbsp;setTextFilterRules(org.primaresearch.shared.variable.VariableMap&nbsp;textFilterRules)</pre>
Expand All @@ -329,6 +338,17 @@ <h4>setTextFilterRules</h4>
</dl>
</li>
</ul>
<a name="handleNegativeCoordinates-org.primaresearch.dla.page.Page-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>handleNegativeCoordinates</h4>
<pre>public static&nbsp;void&nbsp;handleNegativeCoordinates(org.primaresearch.dla.page.Page&nbsp;page,
java.lang.String&nbsp;negCoordsMode)</pre>
<div class="block">Handle negative coordinates of any object with polygon.</div>
</li>
</ul>
</li>
</ul>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Uses of Class org.primaresearch.dla.page.converter.PageConverter (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>org.primaresearch.dla.page.converter (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>org.primaresearch.dla.page.converter (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/org/primaresearch/dla/page/converter/package-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>org.primaresearch.dla.page.converter Class Hierarchy (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/org/primaresearch/dla/page/converter/package-use.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Uses of Package org.primaresearch.dla.page.converter (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions apidoc/overview-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Wed Nov 06 18:08:16 GMT 2019 -->
<!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 10:28:41 GMT 2019 -->
<title>Class Hierarchy (JPageConverter API)</title>
<meta name="date" content="2019-11-06">
<meta name="date" content="2019-11-12">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
Loading

0 comments on commit 56f960e

Please sign in to comment.