//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (https://www.swig.org).
// Version 4.3.0
//
// Do not make changes to this file unless you know what you are doing - modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace Xapian {

public class TfIdfWeight : Weight {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;

  internal TfIdfWeight(global::System.IntPtr cPtr, bool cMemoryOwn) : base(XapianPINVOKE.TfIdfWeight_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TfIdfWeight obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  internal static global::System.Runtime.InteropServices.HandleRef swigRelease(TfIdfWeight obj) {
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
      global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.Dispose();
      return ptr;
    } else {
      return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
    }
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          XapianPINVOKE.delete_TfIdfWeight(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public TfIdfWeight(string normalizations) : this(XapianPINVOKE.new_TfIdfWeight__SWIG_0(normalizations), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public TfIdfWeight(string normalizations, double slope, double delta) : this(XapianPINVOKE.new_TfIdfWeight__SWIG_1(normalizations, slope, delta), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public TfIdfWeight(TfIdfWeight.wdf_norm wdf_normalization, TfIdfWeight.idf_norm idf_normalization, TfIdfWeight.wt_norm wt_normalization) : this(XapianPINVOKE.new_TfIdfWeight__SWIG_2((int)wdf_normalization, (int)idf_normalization, (int)wt_normalization), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public TfIdfWeight(TfIdfWeight.wdf_norm wdf_norm_, TfIdfWeight.idf_norm idf_norm_, TfIdfWeight.wt_norm wt_norm_, double slope, double delta) : this(XapianPINVOKE.new_TfIdfWeight__SWIG_3((int)wdf_norm_, (int)idf_norm_, (int)wt_norm_, slope, delta), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public TfIdfWeight() : this(XapianPINVOKE.new_TfIdfWeight__SWIG_4(), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override string Name() {
    string ret = XapianPINVOKE.TfIdfWeight_Name(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override double GetSumPart(uint wdf, uint doclen, uint uniqterm, uint wdfdocmax) {
    double ret = XapianPINVOKE.TfIdfWeight_GetSumPart(swigCPtr, wdf, doclen, uniqterm, wdfdocmax);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override double GetMaxPart() {
    double ret = XapianPINVOKE.TfIdfWeight_GetMaxPart(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override Weight CreateFromParameters(string params_) {
    global::System.IntPtr cPtr = XapianPINVOKE.TfIdfWeight_CreateFromParameters(swigCPtr, params_);
    TfIdfWeight ret = (cPtr == global::System.IntPtr.Zero) ? null : new TfIdfWeight(cPtr, false);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public enum wdf_norm : byte {
    NONE = 1,
    BOOLEAN = 2,
    SQUARE = 3,
    LOG = 4,
    PIVOTED = 5,
    LOG_AVERAGE = 6,
    AUG_LOG = 7,
    SQRT = 8,
    AUG_AVERAGE = 9,
    MAX = 10,
    AUG = 11
  }

  public enum idf_norm : byte {
    NONE = 1,
    TFIDF = 2,
    SQUARE = 3,
    FREQ = 4,
    PROB = 5,
    PIVOTED = 6,
    GLOBAL_FREQ = 7,
    LOG_GLOBAL_FREQ = 8,
    INCREMENTED_GLOBAL_FREQ = 9,
    SQRT_GLOBAL_FREQ = 10
  }

  public enum wt_norm : byte {
    NONE = 1
  }

}

}
