From 8d57b5b97057d6a795349510b443e7cd1426493f Mon Sep 17 00:00:00 2001 From: luccioman Date: Fri, 30 Sep 2016 17:12:55 +0200 Subject: [PATCH] Added some javadocs. --- .../net/yacy/search/snippet/TextSnippet.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/net/yacy/search/snippet/TextSnippet.java b/source/net/yacy/search/snippet/TextSnippet.java index b10fbd44b..da230fb79 100644 --- a/source/net/yacy/search/snippet/TextSnippet.java +++ b/source/net/yacy/search/snippet/TextSnippet.java @@ -132,9 +132,15 @@ public class TextSnippet implements Comparable, Comparator, Comparator h1 = row.h1(); if (h1 != null && h1.size() > 0 && sentences.size() > 2) { - // find first appearance of first h1 in sencences and then take the next sentence + // find first appearance of first h1 in sentences and then take the next sentence String h1s = h1.get(0); if (h1s.length() > 0) { solrsearch: for (int i = 0; i < sentences.size() - 2; i++) { @@ -268,8 +274,8 @@ public class TextSnippet implements Comparable, Comparator= snippetMaxLength / 4 * 3) break; + s.append(t).append(' '); + if (s.length() >= snippetMaxLength / 4 * 3) break; } if (s.length() > snippetMaxLength) { s.setLength(snippetMaxLength); s.trimToSize(); } textline = s.toString(); @@ -372,14 +378,23 @@ public class TextSnippet implements Comparable, Comparator