<commit_before>﻿// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace Google.Cloud.Translation.V2.Snippets
{
    public class TranslationClientSnippets
    {
        
        public void TranslateTextBaseDefaultModel()
        {
            // Sample: TranslateTextBaseDefaultModel
            TranslationClient client = TranslationClient.Create(model: TranslationModel.Base);
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample
        }

        public void TranslateTextBaseOverrideModel()
        {
            // Sample: TranslateTextBaseOverrideModel
            TranslationClient client = TranslationClient.Create();
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French,
                model: TranslationModel.Base);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample
        }

        [Fact]
        public void TranslateText()
        {
            // Sample: TranslateText
            // Additional: TranslateText(string, string, string, *)
            TranslationClient client = TranslationClient.Create();
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample

            Assert.Equal("Il pleut.", result.TranslatedText);
            Assert.Equal("en", result.DetectedSourceLanguage);
        }
<commit_msg>Make two TranslationClient snippets actual tests.<commit_after>﻿// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace Google.Cloud.Translation.V2.Snippets
{
    public class TranslationClientSnippets
    {
        [Fact]
        public void TranslateTextBaseDefaultModel()
        {
            // Sample: TranslateTextBaseDefaultModel
            TranslationClient client = TranslationClient.Create(model: TranslationModel.Base);
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample

            Assert.Equal("Il pleut.", result.TranslatedText);
            Assert.Equal("en", result.DetectedSourceLanguage);
        }

        [Fact]
        public void TranslateTextBaseOverrideModel()
        {
            // Sample: TranslateTextBaseOverrideModel
            TranslationClient client = TranslationClient.Create();
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French,
                model: TranslationModel.Base);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample

            Assert.Equal("Il pleut.", result.TranslatedText);
            Assert.Equal("en", result.DetectedSourceLanguage);
        }

        [Fact]
        public void TranslateText()
        {
            // Sample: TranslateText
            // Additional: TranslateText(string, string, string, *)
            TranslationClient client = TranslationClient.Create();
            TranslationResult result = client.TranslateText("It is raining.", LanguageCodes.French);
            Console.WriteLine($"Result: {result.TranslatedText}; detected language {result.DetectedSourceLanguage}");
            // End sample

            Assert.Equal("Il pleut.", result.TranslatedText);
            Assert.Equal("en", result.DetectedSourceLanguage);
        }

{'fraction_non_alphanumeric': 0.09365796190850187, 'fraction_numerical': 0.0035342627135283725, 'mean_word_length': 2.7511045655375552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6725725', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1175, 'n_words': 367}