/// <summary>
 /// Creates an instance.
 /// </summary>
 /// <param name="tagger">A tagger that this instnace peeps in.</param>
 /// <remarks>
 /// It is usually easier to use <see cref="Hack.GetDictionaries{TNode}(MeCabTaggerBase{TNode})"/> than this constructor.
 /// </remarks>
 public DictionaryBundle(MeCabTaggerBase <TNode> tagger)
 {
     NodeAllocator = Hack.GetFieldValue(tagger, "nodeAllocator") as Func <TNode>;
     Viterbi       = Hack.GetFieldValue(tagger, "viterbi") as Viterbi <TNode>;
     Connector     = Hack.GetFieldValue(Viterbi, "connector") as Connector <TNode>;
     Tokenizer     = Hack.GetFieldValue(Viterbi, "tokenizer") as Tokenizer <TNode>;
     Dictionaries  = Hack.GetFieldValue(Tokenizer, "dic") as MeCabDictionary[];
 }
Beispiel #2
0
        private unsafe static ulong GetSafeMemoryMappedViewAddress(MeCabDictionary dictionary)
        {
            var   mmfLoader = Hack.GetFieldValue(dictionary, "mmfLoader") as MemoryMappedFileLoader;
            var   mmva      = Hack.GetFieldValue(mmfLoader, "mmva") as MemoryMappedViewAccessor;
            byte *pointer   = null;

            mmva.SafeMemoryMappedViewHandle.AcquirePointer(ref pointer);
            return((ulong)pointer);
        }