Beispiel #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
            };
        }
Beispiel #3
0
 public WordMatrix(WordMatrix orig) : this(modshogunPINVOKE.new_WordMatrix__SWIG_5(WordMatrix.getCPtr(orig)), true) {
   if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #4
0
 internal static HandleRef getCPtr(WordMatrix obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Beispiel #5
0
 internal static HandleRef getCPtr(WordMatrix obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #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());
 }
Beispiel #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]);
            }
        }
Beispiel #8
0
 static void QueryWords(WordMatrix mat, string[] w)
 {
     foreach (var word in w)
     {
         if (mat[word] == null)
         {
             QueryWord(mat, word);
         }
     }
 }
Beispiel #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.");
                }
            }
        }
Beispiel #10
0
 static void Populate(WordMatrix matrix, string word, SpeechClass c)
 {
     matrix.Add(word, new SpeechClass[] { c });
 }
 public RecursiveNetwork(WordMatrix matrix)
     : this()
 {
     this._matrix = matrix;
 }
Beispiel #12
0
        //protected List<ushort> m_aCollisionTypes = new List<ushort>();

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