Exemplo n.º 1
0
        private async Task <Document> ProcessTaggedAsync(ITaggedTextSource tagged)
        {
            var name = tagged.Name;

            Progress($"{name}: Loading...", 0);
            var document = await tagger.DocumentFromTaggedAsync(tagged);

            Progress($"{name}: Loaded", 4 / sourceCount);
            Progress($"{name}: Analyzing Syntax...", 0);
            foreach (var bindingTask in document.GetBindingTasks())
            {
                Progress(bindingTask.InitializationMessage, 0);
                await bindingTask;
                Progress(bindingTask.CompletionMessage, bindingTask.PercentCompleted * 0.71 / sourceCount);
            }
            Progress($"{name}: Correlating Relationships...", 0);
            foreach (var task in document.GetWeightingTasks())
            {
                Progress(task.InitializationMessage, 1 / sourceCount);
                await task;
                Progress(task.CompletionMessage, task.PercentCompleted * 0.59 / sourceCount);
            }
            Progress($"{name}: Coalescing Results...", stepMagnitude);
            return(document);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialized a new instance of the TaggedFilerParser class to parse the contents of the
 /// specified file.
 /// </summary>
 /// <param name="file">
 /// The wrapper which encapsulates the newPath information for the pre-POS-tagged file to parse.
 /// </param>
 public TaggedSourceParser(ITaggedTextSource file)
 {
     TaggedInputData = file.LoadText().Trim();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Asynchronously parses the contents of an ITaggedTextSource containing tagged strings
 /// into a new Document instance.
 /// </summary>
 /// <param name="tagged">The ITaggedTextSource containing tagged strings to parse.</param>
 /// <returns>
 /// A Task&lt;Document&gt; which will contain the source text composed into a fully reified
 /// <see cref="Document"/> instance.
 /// </returns>
 public async Task <Document> DocumentFromTaggedAsync(ITaggedTextSource tagged) => await new TaggedSourceParser(tagged).LoadDocumentAsync(tagged.Name);
Exemplo n.º 4
0
 /// <summary>
 /// Parses the contents of an ITaggedTextSource containing tagged strings to parse into a
 /// new Document instance.
 /// </summary>
 /// <param name="tagged">The ITaggedTextSource containing tagged strings to parse.</param>
 /// <returns>
 /// The contents of the ITaggedTextSource composed into a fully
 /// <see cref="Document"/> instance.
 /// </returns>
 public Document DocumentFromTagged(ITaggedTextSource tagged) => new TaggedSourceParser(tagged).LoadDocument(tagged.Name);