summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-05-31 10:42:15 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-05-31 10:42:15 +0200
commit03132ff40b40fb5bbde27617e644f35623c3b8ee (patch)
treecea7f89826e652cb215a5eada3dd80b6370432cf
parentff6a760c28d16a42bbd09eb29b5b13b4a20778dd (diff)
downloadhastabel2idp-03132ff40b40fb5bbde27617e644f35623c3b8ee.zip
hastabel2idp-03132ff40b40fb5bbde27617e644f35623c3b8ee.tar.bz2
Should output strings correctly (untested).
-rw-r--r--src/hastabel2idp/HastabelResult.java20
-rw-r--r--src/hastabel2idp/Main.java1
2 files changed, 19 insertions, 2 deletions
diff --git a/src/hastabel2idp/HastabelResult.java b/src/hastabel2idp/HastabelResult.java
index 102a229..cc2528b 100644
--- a/src/hastabel2idp/HastabelResult.java
+++ b/src/hastabel2idp/HastabelResult.java
@@ -2,6 +2,8 @@ package hastabel2idp;
import hastabel2idp.OutputFile;
+import hastabel.World;
+import hastabel.Strings;
import hastabel.lang.Type;
import java.util.List;
@@ -36,13 +38,19 @@ public class HastabelResult
public void add_solution
(
+ final World world,
final String predicate,
final List<Type> signature,
final String idp_solution
)
{
add_solution_to_level(predicate, signature);
- add_solution_to_model(predicate, idp_solution);
+ add_solution_to_model
+ (
+ world.get_strings_manager(),
+ predicate,
+ idp_solution
+ );
}
private void add_solution_to_level
@@ -79,6 +87,7 @@ public class HastabelResult
private void add_solution_to_model
(
+ final Strings strings_manager,
final String predicate,
final String idp_solution
)
@@ -106,8 +115,15 @@ public class HastabelResult
model.write(predicate);
model.write("(");
- for (final String param: solution.split(","))
+ for (String param: solution.split(","))
{
+ param = param.trim();
+
+ if (param.startsWith("_string_"))
+ {
+ param = strings_manager.get_string_from_element_name(param);
+ }
+
if (is_first)
{
is_first = false;
diff --git a/src/hastabel2idp/Main.java b/src/hastabel2idp/Main.java
index f775873..879ca53 100644
--- a/src/hastabel2idp/Main.java
+++ b/src/hastabel2idp/Main.java
@@ -80,6 +80,7 @@ public class Main
result.add_solution
(
+ world,
params.get_property_name(),
world.get_variables_manager().get_all_seeked().stream().map
(