コード例 #1
0
        /// <summary>
        /// Reads whole file and process it.
        /// </summary>
        internal void Iterate()
        {
            var freeBaseStreamReader =
                new StreamReader(File);
            string line;

            while ((line = freeBaseStreamReader.ReadLine()) != null)
            {
                var splits = line.Split('\t');

                var source = new FreeBaseNode(splits[0]);
                var edge   = new FreeBaseEdge(splits[1]);
                var target = new FreeBaseNode(splits[2]);

                ProcessEntry(source, edge, target);
                ++_tripletProcessed;

                if (_tripletProcessed % ProcessedCountThreshold == 0)
                {
                    if (ProgressReporter != null)
                    {
                        ProgressReporter(_tripletProcessed);
                    }
                }
            }
        }
コード例 #2
0
        internal SimpleQuestionEntry(string entryLine)
        {
            var tokens = entryLine.Split('\t');

            SupportFact = new FreeBaseNode(tokens[0]);
            Edge        = new FreeBaseEdge(tokens[1]);
            Answer      = new FreeBaseNode(tokens[2]);
            Question    = tokens[3];
        }
コード例 #3
0
 protected abstract void ProcessEntry(FreeBaseNode source, FreeBaseEdge edge, FreeBaseNode target);
コード例 #4
0
 internal FreeBaseTriplet(FreeBaseNode source, FreeBaseEdge edge, FreeBaseNode target)
 {
     Source = source;
     Edge   = edge;
     Target = target;
 }