hdt-java icon indicating copy to clipboard operation
hdt-java copied to clipboard

Add methods to HDTManager store an index at custom place

Open jmkeil opened this issue 6 years ago • 2 comments

Currently, a index created with HDTManager::doIndexedHDT will automatically be storied to a default path (the working directory). It would be very helpful to provide methods to

  • create an index in memory, without writing them to the file system; current workaround:
((TriplesPrivate) hdt.getTriples()).generateIndex(null);
  • store a existing index into a provided OutputStream out; current workaround:
((TriplesPrivate) hdt.getTriples()).saveIndex(out, new ControlInformation(), null);
  • Load an earlier created index from a provided InputStream in; current workaround:
ControlInformation ci = new ControlInformation();
ci.load(in);
((TriplesPrivate) hdt.getTriples()).loadIndex(in, ci, null);

I think, a user of the library should not need to go that deep into the implementation to do this.

jmkeil avatar Jan 23 '19 10:01 jmkeil

Hi @jmkeil would you mind opening a PR for this?

mielvds avatar Apr 16 '21 12:04 mielvds

Hi @jmkeil would you mind opening a PR for this?

As I decided against using HDT in my project, I don't have time to do that. Sorry.

jmkeil avatar Apr 27 '21 14:04 jmkeil