本文整理了Java中zemberek.core.logging.Log.debug()
方法的一些代码示例,展示了Log.debug()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.debug()
方法的具体详情如下:
包路径:zemberek.core.logging.Log
类名称:Log
方法名:debug
暂无
代码示例来源:origin: ahmetaa/zemberek-nlp
public synchronized void initializeStaticCache(Function<String, WordAnalysis> analysisProvider) {
if (staticCacheDisabled || staticCacheInitialized) {
return;
}
new Thread(() -> {
try {
Stopwatch stopwatch = Stopwatch.createStarted();
List<String> words = TextIO.loadLinesFromResource(MOST_USED_WORDS_FILE);
Log.debug("File read in %d ms.", stopwatch.elapsed(TimeUnit.MILLISECONDS));
int size = Math.min(STATIC_CACHE_CAPACITY, words.size());
for (int i = 0; i < size; i++) {
String word = words.get(i);
staticCache.put(word, analysisProvider.apply(word));
}
Log.debug("Static cache initialized with %d most frequent words", size);
Log.debug("Initialization time: %d ms.", stopwatch.elapsed(TimeUnit.MILLISECONDS));
} catch (IOException e) {
Log.error("Could not read most frequent words list, static cache is disabled.");
e.printStackTrace();
}
}).start();
staticCacheInitialized = true;
}
代码示例来源:origin: ahmetaa/zemberek-nlp
Log.debug("Changing log base from " + DEFAULT_LOG_BASE + " to " + logBase);
changeLogBase(logBase);
this.stupidBackoffLogAlpha = (float) (Math.log(stupidBackoffAlpha) / Math.log(logBase));
Log.debug("Applying unigram smoothing with unigram weight: " + unigramWeight);
applyUnigramSmoothing(unigramWeight);
Log.debug("Lm will use stupid back off with alpha value: " + stupidBackoffAlpha);
代码示例来源:origin: ahmetaa/zemberek-nlp
cleanVocab.add(unknownWord);
vocabularyIndexMap.put(unknownWord, indexCounter++);
Log.debug("Necessary special token " + unknownWord
+ " was not found in the vocabulary, it is added explicitly");
cleanVocab.add(sentenceStart);
vocabularyIndexMap.put(sentenceStart, indexCounter++);
Log.debug("Vocabulary does not contain sentence start token, it is added explicitly.");
cleanVocab.add(sentenceEnd);
vocabularyIndexMap.put(sentenceEnd, indexCounter);
Log.debug("Vocabulary does not contain sentence end token, it is added explicitly.");
代码示例来源:origin: ahmetaa/zemberek-nlp
public static Quantizer getQuantizer(File file, int bitCount, QuantizerType quantizerType)
throws IOException {
BinaryFloatFileReader reader = new BinaryFloatFileReader(file);
try (DataInputStream dis = reader.getStream()) {
dis.skipBytes(4); // skip the count.
LookupCalculator lookupCalc = new LookupCalculator(bitCount);
for (int i = 0; i < reader.count; i++) {
double d = dis.readFloat();
lookupCalc.add(d);
if (Log.isDebug() && i % 500000 == 0) {
Log.debug("Values added to value histogram = %d", i);
}
}
return lookupCalc.getQuantizer(quantizerType);
}
}
代码示例来源:origin: ahmetaa/zemberek-nlp
for (int i = 0; i < splitter.pageCount; i++) {
final ByteGramProvider keySegment = splitter.getKeySegment(i);
Log.debug("Segment key count: " + keySegment.keyAmount());
Log.debug("Segment bucket ratio: " + ((double) keySegment.keyAmount() / (1 << bucketBits)));
total += keySegment.keyAmount();
MultiLevelMphf mphf = MultiLevelMphf.generate(keySegment);
Log.debug("Total processed keys:" + total);
int maxMask = (1 << splitter.maxBit) - 1;
int bucketMask = (1 << bucketBits) - 1;
代码示例来源:origin: ahmetaa/zemberek-nlp
Log.debug("Failed key Count:%d " , failedKeyCount);
内容来源于网络,如有侵权,请联系作者删除!