\r\nR342<\/td>\r\n | Carrie Dodson<\/td>\r\n | United States<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n Providing examples constraints<\/h2>\r\nIf the user desires a different split, then they can provide examples constraints<\/em> to specify what kind of split they would like. For instance, if the user wants to separate the first name into a different split cell, then they can provide examples on some of the input rows as follows:\r\n\r\n[code autolinks=\"true\" highlight=\"\"]\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[0].Value, 0, \"PE5\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[0].Value, 1, \"Leonard\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[0].Value, 2, \"Robledo\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[0].Value, 3, \"Australia\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[1].Value, 0, \"U109\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[1].Value, 1, \"Adam\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[1].Value, 2, \"Jay Lucas\"));\r\nsplitSession.Constraints.Add(new NthExampleConstraint(inputs[1].Value, 3, \"New Zealand\"));[\/code]\r\n\r\nEach NthExampleConstraint<\/code> takes three parameters: the input text on which the program will execute (the entire string), the index of the output split cell for which this example is being given, and the text value desired in that split cell. The examples constraints given above describe each of the four split cells that are desired for the first two inputs that have been given in this session. After calling Learn()<\/code> with these constraints, we obtain a program that produces the following output splitting on the three inputs given in this session:\r\n\r\n\r\n\r\nPE5<\/td>\r\n | Leonard<\/td>\r\n | Robledo<\/td>\r\n | Australia<\/td>\r\n<\/tr>\r\n | \r\nU109<\/td>\r\n | Adam<\/td>\r\n | Jay Lucas<\/td>\r\n | New Zealand<\/td>\r\n<\/tr>\r\n | \r\nR342<\/td>\r\n | Carrie<\/td>\r\n | Dodson<\/td>\r\n | United States<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n "}],"slides":[],"related-researchers":[{"type":"user_nicename","display_name":"Vu Le","user_id":39174,"people_section":"Section name 0","alias":"levu"}],"msr_research_lab":[],"msr_impact_theme":[],"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/665793"}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/types\/msr-project"}],"version-history":[{"count":13,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/665793\/revisions"}],"predecessor-version":[{"id":836638,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-project\/665793\/revisions\/836638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media\/674232"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media?parent=665793"}],"wp:term":[{"taxonomy":"msr-research-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/research-area?post=665793"},{"taxonomy":"msr-locale","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-locale?post=665793"},{"taxonomy":"msr-impact-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-impact-theme?post=665793"},{"taxonomy":"msr-pillar","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-pillar?post=665793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} | |