//------------------------------------------------------------------------------ // // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.12 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ public class Tagger : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; internal Tagger(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Tagger obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Tagger() { Dispose(); } public virtual void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; crfsuitePINVOKE.delete_Tagger(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); } } public Tagger() : this(crfsuitePINVOKE.new_Tagger(), true) { if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); } public bool open(string name) { bool ret = crfsuitePINVOKE.Tagger_open__SWIG_0(swigCPtr, name); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public bool open(SWIGTYPE_p_void data, uint size) { bool ret = crfsuitePINVOKE.Tagger_open__SWIG_1(swigCPtr, SWIGTYPE_p_void.getCPtr(data), size); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public void close() { crfsuitePINVOKE.Tagger_close(swigCPtr); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); } public StringList labels() { StringList ret = new StringList(crfsuitePINVOKE.Tagger_labels(swigCPtr), true); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public StringList tag(ItemSequence xseq) { StringList ret = new StringList(crfsuitePINVOKE.Tagger_tag(swigCPtr, ItemSequence.getCPtr(xseq)), true); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public void set(ItemSequence xseq) { crfsuitePINVOKE.Tagger_set(swigCPtr, ItemSequence.getCPtr(xseq)); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); } public StringList viterbi() { StringList ret = new StringList(crfsuitePINVOKE.Tagger_viterbi(swigCPtr), true); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public double probability(StringList yseq) { double ret = crfsuitePINVOKE.Tagger_probability(swigCPtr, StringList.getCPtr(yseq)); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } public double marginal(string y, int t) { double ret = crfsuitePINVOKE.Tagger_marginal(swigCPtr, y, t); if (crfsuitePINVOKE.SWIGPendingException.Pending) throw crfsuitePINVOKE.SWIGPendingException.Retrieve(); return ret; } }