示例#1
0
 public WordMatrix(WordMatrix orig) : this(modshogunPINVOKE.new_WordMatrix__SWIG_5(WordMatrix.getCPtr(orig)), true)
 {
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public void Initialize()
        {
            var rules  = _rulesRepository.LoadData();
            var values = _valuesRepository.LoadData();
            var words  = _wordsRepository.LoadData();
            var cypher = _cypherRepository.LoadData();

            matrix = new WordMatrix()
            {
                Rules  = rules,
                Values = values,
                Words  = words,
                Cypher = cypher
            };
        }
示例#3
0
 public WordMatrix(WordMatrix orig) : this(modshogunPINVOKE.new_WordMatrix__SWIG_5(WordMatrix.getCPtr(orig)), true) {
   if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
 }
示例#4
0
 internal static HandleRef getCPtr(WordMatrix obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
示例#5
0
 internal static HandleRef getCPtr(WordMatrix obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
示例#6
0
 static void AddSample(WordMatrix mat, string word1, string word2, SpeechEntity result, double expected)
 {
     ex.Add(SpeechEntity.Group(mat[word1], mat[word2]));
     res.Add(result.ToArray().Concat(new double[] { expected }).ToArray());
 }
示例#7
0
        static void RawPopulate(WordMatrix matrix)
        {
            SpeechEntity v = matrix["_VOID_"];

            string[] names = Enum.GetNames(typeof(SpeechClass));
            SpeechClass[] values = (SpeechClass[])Enum.GetValues(typeof(SpeechClass));

            for (int i = 0; i < names.Length; i++)
            {
                Populate(matrix, names[i], values[i]);
            }
        }
示例#8
0
 static void QueryWords(WordMatrix mat, string[] w)
 {
     foreach (var word in w)
     {
         if (mat[word] == null)
         {
             QueryWord(mat, word);
         }
     }
 }
示例#9
0
        static void QueryWord(WordMatrix mat, string w)
        {
            Console.WriteLine("The word \"" + w + "\" is unknow");
            Console.Write("Type the word's grammar type : ");

            while(true)
            {
                string className = Console.ReadLine();
                if(Enum.IsDefined(typeof(SpeechClass), className))
                {
                    Populate(mat, w, (SpeechClass)Enum.Parse(typeof(SpeechClass), className, true));
                    break;
                }
                else
                {
                    Console.WriteLine("This class does not exist.");
                }
            }
        }
示例#10
0
 static void Populate(WordMatrix matrix, string word, SpeechClass c)
 {
     matrix.Add(word, new SpeechClass[] { c });
 }
示例#11
0
 public RecursiveNetwork(WordMatrix matrix)
     : this()
 {
     this._matrix = matrix;
 }
示例#12
0
        //protected List<ushort> m_aCollisionTypes = new List<ushort>();

        public CollisionMap(D2Game game)
        {
            this.game = game;
            m_map     = new WordMatrix();
        }
示例#13
0
 public bool CopyMapData(WordMatrix rBuffer)
 {
     m_map.ExportData(rBuffer);
     return(rBuffer.IsCreated());
 }