You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/12/22 18:28:36 UTC
jena git commit: Cleanup : remove TextHitConverter and refer comment
about it.
Repository: jena
Updated Branches:
refs/heads/master 212d588e1 -> 8e615f162
Cleanup : remove TextHitConverter and refer comment about it.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8e615f16
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8e615f16
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8e615f16
Branch: refs/heads/master
Commit: 8e615f1627844e77fe2a196f51c3cf9a3c1fbde5
Parents: 212d588
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Dec 22 17:28:12 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Dec 22 17:28:12 2015 +0000
----------------------------------------------------------------------
.../jena/query/text/TextHitConverter.java | 56 --------------------
.../org/apache/jena/query/text/TextQueryPF.java | 2 -
2 files changed, 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/8e615f16/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java b/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
deleted file mode 100644
index c15a449..0000000
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.query.text ;
-
-import java.util.function.Function;
-
-import org.apache.jena.sparql.core.Var;
-import org.apache.jena.sparql.engine.binding.Binding;
-import org.apache.jena.sparql.engine.binding.BindingFactory;
-import org.apache.jena.sparql.engine.binding.BindingMap;
-import org.apache.jena.sparql.util.NodeFactoryExtra;
-
-/** Class that converts TextHits to Bindings that can be returned from query */
-public class TextHitConverter implements Function<TextHit, Binding>
-{
- private Binding binding;
- private Var match;
- private Var score;
- private Var literal;
-
- public TextHitConverter(Binding binding, Var match, Var score, Var literal) {
- this.binding = binding;
- this.match = match;
- this.score = score;
- this.literal = literal;
- }
-
- @Override
- public Binding apply(TextHit hit) {
- if (score == null && literal == null)
- return BindingFactory.binding(binding, match, hit.getNode());
- BindingMap bmap = BindingFactory.create(binding);
- bmap.add(match, hit.getNode());
- if (score != null)
- bmap.add(score, NodeFactoryExtra.floatToNode(hit.getScore()));
- if (literal != null)
- bmap.add(literal, hit.getLiteral());
- return bmap;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/8e615f16/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java b/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
index 1ad33c4..f4e1402 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
@@ -198,8 +198,6 @@ public class TextQueryPF extends PropertyFunctionBase {
Var scoreVar = (score==null) ? null : Var.alloc(score) ;
Var literalVar = (literal==null) ? null : Var.alloc(literal) ;
List<TextHit> r = query(match.getProperty(), match.getQueryString(), match.getLimit(), execCxt) ;
- //Function<TextHit,Binding> converter = new TextHitConverter(binding, sVar, scoreVar, literalVar);
-
Function<TextHit,Binding> converter = (TextHit hit) -> {
if (score == null && literal == null)
return BindingFactory.binding(binding, sVar, hit.getNode());