// 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Semantic structural classification of a text chunk.
 *
 * Assigned by the heuristic classifier in {@code chunking.classifier}.
 * Defaults to {@code Unknown} when no rule matches.
 * Designed to be extended in future versions without breaking changes.
 */
public enum ChunkType {
    /** Section heading or document title. */
    Heading("heading"),
    /** Party list: names, addresses, and signatories. */
    PartyList("party_list"),
    /** Definition clause ("X means…", "X shall mean…"). */
    Definitions("definitions"),
    /** Operative clause containing legal/contractual action verbs. */
    OperativeClause("operative_clause"),
    /** Signature block with signatures, names, and dates. */
    SignatureBlock("signature_block"),
    /** Schedule, annex, appendix, or exhibit section. */
    Schedule("schedule"),
    /** Table-like content with aligned columns or repeated patterns. */
    TableLike("table_like"),
    /** Mathematical formula or equation. */
    Formula("formula"),
    /** Code block or preformatted content. */
    CodeBlock("code_block"),
    /** Embedded or referenced image content. */
    Image("image"),
    /** Organizational chart or hierarchy diagram. */
    OrgChart("org_chart"),
    /** Diagram, figure, or visual illustration. */
    Diagram("diagram"),
    /** Unclassified or mixed content. */
    Unknown("unknown");

    /** The string value. */
    private final String value;

    ChunkType(final String value) {
        this.value = value;
    }

    /** Returns the string value. */
    @JsonValue
    public String getValue() {
        return value;
    }

    /** Creates an instance from a string value. */
    @JsonCreator
    public static ChunkType fromValue(final String value) {
        for (ChunkType e : values()) {
            if (e.value.equalsIgnoreCase(value)) {
                return e;
            }
        }
        throw new IllegalArgumentException("Unknown value: " + value);
    }

    /** Returns the wire-format string value (matches JSON serialization). */
    @Override
    public String toString() {
        return value;
    }
}
