public void persistentDocumentStream() throws IOException, URISyntaxException {
    //	lda.getLda().write(new File(this.rootDir+"model.mallet"));
    //	lda.getLda().printTopWords(new File(this.rootDir+"words.txt"), 10, false);

    //	if(settings.localStore)
    lda.getLda().write(new File(this.rootDir + "model.mallet"));

    // persistent words per topic
    if (settings.hbaseImport) {

      List<Phrases> phrasesList = lda.getLda().getPhrases();

      for (int k = 0; k < phrasesList.size(); k++) {
        Phrases phrases = phrasesList.get(k);
        List<NGram> words = phrases.getSortedNGrams(settings.maxWordsPerTopic, 0);

        HBaseProxyManager.getProxy().putWords(words, k, ts);
      }
    }
  }
Example #2
0
  public Blibliki createBlibliki(int bliblikiIndex) {

    switch (bliblikiIndex) {
      default:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new SynthInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
      case B_SPARK:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new SparkInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
      case B_KICK:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new KickInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
      case B_SNARE:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new SnareInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
      case B_TONE:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new ToneInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
      case B_TSIK:
        return new Blibliki(
            Phrases.getPhrase(phraseType, 4),
            new TsikInstrumentGenerator(),
            new ConstellationBody(pa),
            out);
    }
  }