fixes to parser

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6323 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 4a1c852435
commit 902d16cf6c

@ -555,12 +555,10 @@ dc_rights
} }
public int inboundLinks() { public int inboundLinks() {
assert this.inboundLinks >= 0;
return (this.inboundLinks < 0) ? 0 : this.inboundLinks; return (this.inboundLinks < 0) ? 0 : this.inboundLinks;
} }
public int outboundLinks() { public int outboundLinks() {
assert this.outboundLinks >= 0;
return (this.outboundLinks < 0) ? 0 : this.outboundLinks; return (this.outboundLinks < 0) ? 0 : this.outboundLinks;
} }

@ -124,6 +124,7 @@ public class tarParser extends AbstractParser implements Idiom {
// skip directories // skip directories
if (entry.isDirectory()) continue; if (entry.isDirectory()) continue;
if (entry.getSize() <= 0) continue;
// Get the short entry name // Get the short entry name
final String entryName = entry.getName(); final String entryName = entry.getName();

@ -113,6 +113,7 @@ public class zipParser extends AbstractParser implements Idiom {
// skip directories // skip directories
if (entry.isDirectory()) continue; if (entry.isDirectory()) continue;
if (entry.getSize() <= 0) continue;
// Get the entry name // Get the entry name
final String entryName = entry.getName(); final String entryName = entry.getName();

@ -82,7 +82,7 @@ public class DocumentIndex extends Segment {
throw new IOException("cannot parse " + file.toString() + ": " + e.getMessage()); throw new IOException("cannot parse " + file.toString() + ": " + e.getMessage());
} }
final Condenser condenser = new Condenser(document, true, true); final Condenser condenser = new Condenser(document, true, true);
return super.storeDocument( return super.storeDocument(
url, url,
null, null,
new Date(file.lastModified()), new Date(file.lastModified()),
@ -119,7 +119,7 @@ public class DocumentIndex extends Segment {
try { try {
add(w); add(w);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); if (e.getMessage().indexOf("cannot parse") < 0) e.printStackTrace();
} }
} }
} }
@ -154,6 +154,10 @@ public class DocumentIndex extends Segment {
return find(querystring, 0, 20); return find(querystring, 0, 20);
} }
public void close() {
super.close();
}
public static void main(String[] args) { public static void main(String[] args) {
// first argument: path to segment // first argument: path to segment
// second argument: either 'add' or 'search' // second argument: either 'add' or 'search'

Loading…
Cancel
Save