Exemple #1
0
        public void CreateTokenizationDictionary()
        {
            IamConfig config = new IamConfig(
                apikey: apikey
                );

            DiscoveryService service = new DiscoveryService(versionDate, config);

            service.SetEndpoint(url);

            var tokenizationRules = new List <TokenDictRule>()
            {
                new TokenDictRule()
                {
                    Text   = "すしネコ",
                    Tokens = new List <string>()
                    {
                        "すし", "ネコ"
                    },
                    Readings = new List <string>()
                    {
                        "寿司", "ネコ"
                    },
                    PartOfSpeech = "カスタム名詞"
                }
            };

            var result = service.CreateTokenizationDictionary(
                environmentId: environmentId,
                collectionId: collectionId,
                tokenizationRules: tokenizationRules
                );

            Console.WriteLine(result.Response);
        }
        public void CreateTokenizationDictionary()
        {
            IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}");

            DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);

            service.SetServiceUrl("{serviceUrl}");

            var tokenizationRules = new List <TokenDictRule>()
            {
                new TokenDictRule()
                {
                    Text   = "すしネコ",
                    Tokens = new List <string>()
                    {
                        "すし", "ネコ"
                    },
                    Readings = new List <string>()
                    {
                        "寿司", "ネコ"
                    },
                    PartOfSpeech = "カスタム名詞"
                }
            };

            var result = service.CreateTokenizationDictionary(
                environmentId: "{environmentId}",
                collectionId: "{collectionId}",
                tokenizationRules: tokenizationRules
                );

            Console.WriteLine(result.Response);
        }
        public void CreateTokenizationDictionary()
        {
            TokenOptions tokenOptions = new TokenOptions()
            {
                IamApiKey  = apikey,
                ServiceUrl = url
            };

            DiscoveryService service = new DiscoveryService(tokenOptions, versionDate);

            var tokenizationRules = new List <TokenDictRule>()
            {
                new TokenDictRule()
                {
                    Text   = "すしネコ",
                    Tokens = new List <string>()
                    {
                        "すし", "ネコ"
                    },
                    Readings = new List <string>()
                    {
                        "寿司", "ネコ"
                    },
                    PartOfSpeech = "カスタム名詞"
                }
            };

            var result = service.CreateTokenizationDictionary(
                environmentId: environmentId,
                collectionId: collectionId,
                tokenizationRules: tokenizationRules
                );

            Console.WriteLine(result.Response);
        }