예제 #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;
 }