示例#1
0
def gender_neutral():
    try:
        sentence = request.args.get('sentence', 0, type=str)
        neutral_sentence = convert(sentence)
        results = {
            'original_sentence': sentence,
            'neutral_sentence': neutral_sentence
        }
        return jsonify(results)

    except Exception as e:
        return e
 def test_convert_her_2(self):
     assert convert("This pen belongs to her.") == "This pen belongs to them."
 def test_convert_her_1(self):
     assert convert("This is her pen.") == "This is their pen."
 def test_convert_his_2(self):
     assert convert("This pen is his.") == "This pen is theirs."
 def test_identity_3(self):
     assert convert("the the the the the") == "the the the the the"
 def test_identity_2(self):
     assert convert("He'shan") == "He'shan"
 def test_identity_1(self):
     assert convert("They are going to the park.") == "They are going to the park."