72 lines
2.3 KiB
Java
72 lines
2.3 KiB
Java
|
|
// This file is auto-generated by alef — DO NOT EDIT.
|
||
|
|
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
|
||
|
|
// To regenerate: alef generate
|
||
|
|
// To verify freshness: alef verify --exit-code
|
||
|
|
// Issues & docs: https://github.com/kreuzberg-dev/alef
|
||
|
|
package dev.kreuzberg;
|
||
|
|
|
||
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||
|
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||
|
|
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* RAKE-specific parameters.
|
||
|
|
*/
|
||
|
|
@JsonInclude(JsonInclude.Include.NON_ABSENT)
|
||
|
|
@JsonDeserialize(builder = RakeParams.Builder.class)
|
||
|
|
public record RakeParams(
|
||
|
|
/**
|
||
|
|
* Minimum word length to consider (default: 1).
|
||
|
|
*/
|
||
|
|
@JsonProperty("min_word_length") long minWordLength,
|
||
|
|
/**
|
||
|
|
* Maximum words in a keyword phrase (default: 3).
|
||
|
|
*/
|
||
|
|
@JsonProperty("max_words_per_phrase") long maxWordsPerPhrase
|
||
|
|
) {
|
||
|
|
public static Builder builder() {
|
||
|
|
return new Builder();
|
||
|
|
}
|
||
|
|
public RakeParams{
|
||
|
|
if (minWordLength == 0) minWordLength = 1;
|
||
|
|
if (maxWordsPerPhrase == 0) maxWordsPerPhrase = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
// CPD-OFF
|
||
|
|
@JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
|
||
|
|
public static final class Builder {
|
||
|
|
|
||
|
|
@JsonProperty("min_word_length")
|
||
|
|
private long minWordLength = 0;
|
||
|
|
@JsonProperty("max_words_per_phrase")
|
||
|
|
private long maxWordsPerPhrase = 0;
|
||
|
|
|
||
|
|
/** Sets the minWordLength field. */
|
||
|
|
@JsonProperty("min_word_length")
|
||
|
|
public Builder withMinWordLength(final long value) {
|
||
|
|
this.minWordLength = value;
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** Sets the maxWordsPerPhrase field. */
|
||
|
|
@JsonProperty("max_words_per_phrase")
|
||
|
|
public Builder withMaxWordsPerPhrase(final long value) {
|
||
|
|
this.maxWordsPerPhrase = value;
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** Builds the RakeParams instance. */
|
||
|
|
public RakeParams build() {
|
||
|
|
return new RakeParams(
|
||
|
|
minWordLength,
|
||
|
|
maxWordsPerPhrase
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
// CPD-ON
|
||
|
|
public static RakeParams defaultInstance() {
|
||
|
|
throw new UnsupportedOperationException("defaultInstance is not yet bridged via JNI; use the Builder instead.");
|
||
|
|
}
|
||
|
|
}
|