Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent fail of LearnSequenceReferencingSibling example in WranglingSamples #10

Closed
eglassman opened this issue Feb 6, 2017 · 3 comments

Comments

@eglassman
Copy link

eglassman commented Feb 6, 2017

The LearnSequenceReferencingSibling example in WranglingSamples does not print anything. In the following code (linked here: https://github.com/Microsoft/prose/blob/master/Extraction.Text/LearningSamples.cs#L388-L393), instead of iterating over the regions as in prior documentation examples found in https://microsoft.github.io/prose/documentation/extraction-text/usage/#extracting-a-sequence-of-stringregions
like this:

foreach (var r in topRankedProg.Run(countries))
{
    var output = r.Output != null ? r.Output.Value : "null";
    Console.WriteLine("\"{0}\" => \"{1}\"", r.Reference, output);
}

it iterates over a much more complicated expression, which returns an empty list:

foreach (var a in areas
                .SelectMany(area => topRankedProg.Run(area)
                                                    .Select(output => new { Input = area, Output = output }))) {
                var output = a.Output != null ? a.Output.Value : "null";
                Console.WriteLine("\"{0}\" => \"{1}\"", a.Input, output);
            }

I tried changing this example to iterate over topRankedProg.Run(areas) so it's more like the example in the documentation, but the object returned by topRankedProgram.Run( ) does not out an output field.
Help?

@vuminhle
Copy link
Member

vuminhle commented Feb 9, 2017

Hi. We are updating the samples and the documentation.
Please stay tuned. Thanks for your patience.

@vuminhle
Copy link
Member

@eglassman The new samples and documentation have been released.
Can you try again? Thanks.

@alexpolozov
Copy link
Contributor

With release 1.1.0, we are making the public API for interacting with DSLs more intuitive. Please check out the new LearnSequenceReferencingSibling sample.

alexpolozov added a commit that referenced this issue May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants